[VC MFC C++ flex bison] flex format

来源:互联网 发布:学粤语软件哪个软件好 编辑:程序博客网 时间:2024/05/22 00:45

definitions
%%
rules
%%
user code
 

 

name definition

The "name" is a word beginning with a letter or an underscore ('_') followed by zero or more letters, digits, '_', or '-' (dash). The definition is taken to begin at the first non-white-space character following the name and continuing to the end of the line. The definition can subsequently be referred to using "{name}", which will expand to "(definition)". For example,

DIGIT    [0-9]ID       [a-z][a-z0-9]*

defines "DIGIT" to be a regular expression which matches a single digit, and "ID" to be a regular expression which matches a letter followed by zero-or-more letters-or-digits. A subsequent reference to

{DIGIT}+"."{DIGIT}*

is identical to

([0-9])+"."([0-9])*
原创粉丝点击