New ideas.

2008年4月6日星期日

Lexer Grammar in EBNF


TokenList
-> Token
-> TokenList Token
Token
-> Number +> num
-> Ident +> ident
-> Operator +> oper
-> Blank
$Digit -> "0123456789"
$Letter -> "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
Space -> " \r\n"
$Ident
-> Letter
-> Ident Letter
-> Ident Digit
$Number -> Digit... [ '.' Digit...]
$Operator -> '+' '-' '*' '/' '^' '<' '>' '<=' '>=' '==' '!='
Blank
-> Space
-> Blank Space

没有评论:

My Introduction

Shanghai, China
Software Developer. Mainly work in C#.