mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
50 lines
620 B
Text
50 lines
620 B
Text
#
|
|
# racc syntax checker
|
|
#
|
|
|
|
class M1::M2::ParserClass < S1::S2::SuperClass
|
|
|
|
token A
|
|
| B C
|
|
|
|
convert
|
|
A '5'
|
|
end
|
|
|
|
prechigh
|
|
left B
|
|
preclow
|
|
|
|
start target
|
|
|
|
expect 0
|
|
|
|
rule
|
|
|
|
target: A B C
|
|
{
|
|
print 'abc'
|
|
}
|
|
| B C A
|
|
| C B A
|
|
{
|
|
print 'cba'
|
|
}
|
|
| cont
|
|
|
|
cont : A c2 B c2 C
|
|
|
|
c2 : C C C C C
|
|
|
|
end
|
|
|
|
---- inner
|
|
|
|
junk code !!!!
|
|
|
|
kjaljlajrlaolanbla /// %%% (*((( token rule
|
|
akiurtlajluealjflaj @@@@ end end end end __END__
|
|
laieu2o879urkq96ga(Q#*&%Q#
|
|
#&lkji END
|
|
|
|
q395q?/// liutjqlkr7
|