home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ruby164.zip / rbemx164.zip / ruby / share / doc / racc-1.3.9 / sample / syntax.y < prev    next >
Text File  |  2001-04-07  |  627b  |  50 lines

  1. #
  2. # racc syntax checker (does not work. use for check only)
  3. #
  4.  
  5. class P
  6.  
  7.   token A B C
  8.  
  9.   convert
  10.     A '5'
  11.   end
  12.  
  13.   prechigh
  14.     left B
  15.   preclow
  16.  
  17.   options omit_action_call
  18.  
  19.   start target
  20.  
  21. rule
  22.  
  23.   target: A B C
  24.             {
  25.               print 'abc'
  26.             }
  27.         | B C A
  28.         | C B A
  29.             {
  30.               print 'cba'
  31.             }
  32.         | cont
  33.   
  34.   cont  : A c2 B c2 C
  35.  
  36.   c2    : C C C C C
  37.  
  38. end
  39.  
  40. ---- inner
  41.  
  42.     junk code  !!!!
  43.  
  44. kjaljlajrlaolanbla  /// %%%  (*((( token rule
  45. akiurtlajluealjflaj    @@@@   end end end end __END__
  46.   laieu2o879urkq96ga(Q#*&%Q#
  47.  #&lkji  END
  48.  
  49.          q395q?///  liutjqlkr7
  50.