data.g
上传用户:afrynkmhm
上传日期:2007-01-06
资源大小:1262k
文件大小:1k
- options {
- language = "Sather";
- }
- class DATA_PARSER extends Parser;
- {
- println ( s : STR ) is
- #OUT + s + "n";
- end;
- }
-
- file: ( sh:SHORT {println(sh.text);}
- | st:STRING {println(""" + st.text + """);}
- )+
- ;
- class DATA_LEXER extends Lexer;
- options {
- charVocabulary = 'u0000'..'u00FF';
- }
- SHORT
- : ' ' high:. lo:.
- {
- v : INT := high.int.lshift(8) + lo.int;
- %setText(""+v);
- }
- ;
- STRING
- : '1'! // begin string (discard)
- ( ~'2' )*
- '2'! // end string (discard)
- ;