Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2013
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1.  
  2. grammar mccproperty;
  3.  
  4.  
  5.  
  6. ID:
  7. ('a'..'z'|'A'..'Z'|'0'..'9'|'_')+;
  8.  
  9.  
  10. EOL:
  11. ('\r' | '\n')+;
  12.  
  13. S : ('\s' | ' ')+ ;
  14.  
  15. identifier: ID;
  16.  
  17. property_set: property+;
  18.  
  19. comparer : '=' | '!=' | '<' | '<=' | '>' | '>=';
  20. mop : '&' | '|';
  21. operator : 'I' | 'N' | 'A' | 'E' | 'G' | 'F';
  22. ifs : '=>' | '<=>';
  23. x : 'X';
  24. xor : 'xor';
  25. space: S? ;
  26. not : '!';
  27. untils : 'U' | 'W';
  28. //integer : ('0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9')+ | DIGIT+;
  29. fragment DIGIT : [0-9] ;
  30. integer : DIGIT+ ;
  31.  
  32.  
  33. property:
  34. ( 'reach' | 'struct' | 'ctl' | 'ltl' )? space identifier space ':' space complex_formula space EOL
  35. ;
  36.  
  37. simple_formula: space (
  38. 'true'
  39. | 'false'
  40. | '(' complex_formula ')'
  41. | not simple_formula
  42. | x integer? '~'? simple_formula
  43. | operator simple_formula
  44. | 'deadlock'
  45. | identifier '?' ('l0' | 'l1' | 'l2' | 'l3' | 'l4')?
  46. | complex_expression comparer complex_expression
  47. ) space;
  48.  
  49. complex_formula:
  50. simple_formula (
  51. (mop simple_formula)+
  52. | (xor simple_formula)
  53. | (ifs simple_formula)
  54. | (untils simple_formula)
  55. )?
  56. ;
  57.  
  58.  
  59. complex_expression:
  60. simple_expression
  61. ( ('+' simple_expression)+
  62. | ('*' simple_expression)+
  63. | ('-' simple_expression)
  64. | ('/' simple_expression)
  65. space )?
  66. ;
  67.  
  68. simple_expression:
  69.  
  70. (integer)+
  71. | 'bound' '(' identifier ')'
  72. | '|' complex_expression '|'
  73. | '<' anonymous_bindings '>'
  74. | 'marking' '(' identifier ')'
  75. | '(' complex_expression ')'
  76. ;
  77.  
  78. anonymous_bindings:
  79. ( identifier (',' identifier)* )?;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement