Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grammar alsastates;
- options {
- language = Java;
- }
- tokens {
- APOS = '\'' ;
- CONTROL = 'control' ;
- }
- carddef : (Text '.' Text '{' ctrldef* '}') EOF ;
- ctrldef : (CONTROL '.' Index '{' (iface|name|value|index|comment)+ '}' )+ ;
- iface : 'iface' Text ;
- name : 'name' TextAPOS ;
- value : 'value' ( '.' Index)? (Text|Index|TextAPOS)+ ;
- index : 'index' Index ;
- comment : 'comment' '{' com_access
- | com_type
- | com_count
- | com_range
- | com_dbmin
- | com_dbmax
- | com_item
- | com_tlv
- | (com_dbvalue)+
- '}' ;
- // | (Text|Index|'-'|'+'|'.'|TextAPOS)* '}' ;
- com_access : 'access' (Text|Index|TextAPOS)+ ;
- com_type : 'type' ('INTEGER' | 'BOOLEAN' | 'ENUMERATED' | 'IEC958') ;
- com_count : 'count' Index ;
- com_range : 'range' TextAPOS ;
- com_dbmin : 'dbmin' (Minus)? Index ;
- com_dbmax : 'dbmax' (Minus)? Index ;
- com_dbvalue : 'dbvalue' ('.' Index)? Index ;
- com_item : 'item' ('.' Index)? ((Text)+|TextAPOS) ;
- com_tlv : 'tlv' TextAPOS ;
- Index : (Digit)+ ;
- Text : (Letter|Digit)+ ;
- TextAPOS : APOS (Text|S|'-')+ APOS;
- fragment Minus: '-' ;
- fragment Digit: '0'..'9' ;
- fragment Letter : ('a'..'z'|'A'..'Z') ;
- fragment S : ' ';
- WS : (' '|'\n'|'\r'|'\t')+ {$channel=HIDDEN;} ;
Add Comment
Please, Sign In to add comment