Github地址:https://github.com/Mr-Porridge/Highlight-Spirit
請點個star後大家隨便使用
如遇到問題 隨時提交issue或聯繫本人即可 謝謝!
(一)C++高級程序設計語言的子集
分類號 |
分類內容 |
0 |
保留字 |
1 |
標識符 |
2 |
常量 |
3 |
運算符 |
4 |
分隔符 |
- 【0】保留字:
C++保留字49個:
cin,cout,return,extern,public,template,this,
if,else,while,signed,throw,union,this,
int,char,double,float,unsigned,const,goto,
include,for,long,short,virtual,sizeof,static,string,
struct,typedef,break,auto,void,stdio,class,
try,catch,defalt,false,true,virtual,delete
friend,inline,,namespace,new,operator,private,protected
C++額外保留字3個:
endl,printf, scanf,
- 【1】標識符:即變量
標識符={以字母或''_''開頭的,包含字母、下劃線、數字的字符串}
- 【2】常量:
常量={整數、浮點數、布爾型常量、字符型常量}
- 【3】運算符:
運算符={算術運算符、關係運算符、邏輯運算符、位運算符、賦值運算符、雜項運算符}
- 【4】分隔符:
分隔符={'':'', '' ; '', '','', ''('', '')'', ''{'', ''}'', ''['', '']''}
(二)覆蓋以上子集的正規文法
【接着補】 未完待續