http://www.cs.chalmers.se/Cs/Research/Language-technology/BNFC/
ラベル付きのBNFを記述して、BNFCにINIパーサーを生成させるにはどうすればよいですか?
私は今のところo__Oしか得ていません!
entrypoints File ;
comment "#" ;
token ID ( letter | digit | ["-_'"] )+ ;
Ini. File ::= [Section] ;
Sect. Section ::= "[" ID "]" [Statement] ;
Bind. Statement ::= ID "=" ID ;
separator Statement "\n" ;
terminator Section "" ;
[name]
#x = 10
y = 20
Parse Successful!
[Abstract Syntax]
Ini [Sect (ID "name") [Bind (ID "y") (ID "20")]]
[Linearized tree]
[name]y = 20
[name]
x = 10
#y = 20
Parse Successful!
[Abstract Syntax]
Ini [Sect (ID "name") [Bind (ID "x") (ID "10")]]
[Linearized tree]
[name]x = 10
o__O行き詰まっています..。