Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Simple grammar not working
  2. grammar Keyword;
  3.  
  4. // PARSER RULES
  5. //
  6. entry_point :   ('['ID']')*;
  7.  
  8. // LEXER RULES
  9. //
  10. KEYWORD     :   '[Keyword]';
  11.  
  12. ID      :   ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*;
  13. WS      :   ( ' ' | 't' | 'r' | 'n' | 'rn')
  14.             {
  15.                 $channel = HIDDEN;
  16.             };
  17.        
  18. [Hi]
  19. [Hi]
  20.        
  21. [Hi]
  22. [Ki]
  23.        
  24. grammar Keyword;
  25.  
  26. // PARSER RULES
  27. //
  28. entry_point :   ID*;
  29.  
  30. // LEXER RULES
  31. //
  32. KEYWORD     :   '[Keyword]';
  33.  
  34. ID      :   '[' ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')* ']';
  35. WS      :   ( ' ' | 't' | 'r' | 'n' | 'rn')
  36.             {
  37.                 $channel = HIDDEN;
  38.             };