我正在使用xtext来制作语法。目前我有这样的代码:
Model: (commands+=Commands)*;
Commands:
SetCommand|CommentCommand|WhileCommand|OutputCommand
|SelectCommand|OptionCommand|InsertAfterCommand|AdaptCommand;
OptionCommand:
'#option' EXPRESSION((EXPRESSION)|(WS)|(InsertAfterCommand)|('='))* '#endoption' ;
terminal EXPRESSION:
('a'..'z'|'A'..'Z'|'0'..'9'|'-'|'@'
|'.'|'?'|'\''|':'|'\"'|'>'
|'<'|'/'|'_'|';'|'('|')'
|'&'|'!'|'#'|'*'|'+'|'['|']'|'{'|'}')
('a'..'z'|'A'..'Z'|'0'..'9'|'-'|'@'
|'.'|'?'|'\''|':'|'\"'|'>'
|'<'|'/'|'_'|';'|'('|')'
|'&'|'!'|'#'|'%'|'*'|'+'|'['|']'|'{'|'}')* ;
但如果有像a="he is a good boy"
这样的代码,它总是会在每个空格上出错。