[antlr-interest] Config file parsing grammar

James Cook bonkabonka at gmail.com
Sat Nov 25 12:23:32 PST 2006


On 11/25/06, Terence Parr <parrt at cs.usfca.edu> wrote:
> Hi.  Try -trace or -debug options (that last one requires ANTLRWorks)

Okay, I did the trace but I'm not sure I understand what I'm seeing
(gods above, this stuff makes me stupid and full of suck).  I am
suspicious of some stuff I see towards the end of the trace, notably:

exit WHITESPACE 'f' line=5:23 failed=false backtracking=0
enter HOSTNAME 'f' line=5:23 failed=false backtracking=0
enter DNSCHAR 'f' line=5:23 failed=false backtracking=0
enter LETTER 'f' line=5:23 failed=false backtracking=0
exit LETTER 'o' line=5:24 failed=false backtracking=0
exit DNSCHAR 'o' line=5:24 failed=false backtracking=0
enter DNSCHAR 'o' line=5:24 failed=false backtracking=0
enter LETTER 'o' line=5:24 failed=false backtracking=0
exit LETTER 'u' line=5:25 failed=false backtracking=0
exit DNSCHAR 'u' line=5:25 failed=false backtracking=0
enter DNSCHAR 'u' line=5:25 failed=false backtracking=0
enter LETTER 'u' line=5:25 failed=false backtracking=0
exit LETTER 'r' line=5:26 failed=false backtracking=0
exit DNSCHAR 'r' line=5:26 failed=false backtracking=0
enter DNSCHAR 'r' line=5:26 failed=false backtracking=0
enter LETTER 'r' line=5:26 failed=false backtracking=0
exit LETTER '
' line=5:27 failed=false backtracking=0
exit DNSCHAR '
' line=5:27 failed=false backtracking=0
exit HOSTNAME '
' line=5:27 failed=false backtracking=0
enter NEWLINE '
' line=5:27 failed=false backtracking=0
exit NEWLINE 'ï¿¿' line=6:0 failed=false backtracking=0
enter go [@0,0:10='192.168.0.1',<22>,1:0] failed=false backtracking=0
enter hostline [@0,0:10='192.168.0.1',<22>,1:0] failed=false backtracking=0
alias: [@4,22:24='one',<26>,1:22]
alias: [@6,26:32='primary',<26>,1:26]
alias: [@8,34:39='master',<26>,1:34]
ip addr  : [@0,0:10='192.168.0.1',<22>,1:0]
hostname : [@2,12:20='one.local',<26>,1:12]
exit hostline [@10,41:41='\n',<5>,2:0] failed=false backtracking=0
exit go [@10,41:41='\n',<5>,2:0] failed=false backtracking=0

I don't have an exclamation followed by two upside-down question marks
in the file.  Also, the lexer is parsing the whole shootin' match but
the Parser seems to only process records prior to the comment or blank
line.  I think.  I'm running the file against a sample file that looks
like:

192.168.0.1     one.local one primary master

192.168.0.2     two.local two secondary
192.168.0.3     three.local three
192.168.0.4     four.local four

And, I'm attaching the trace (it's ... big - perhaps I need to
collapse some of the rules rather than referencing fragments).

-- 
James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trace
Type: application/octet-stream
Size: 26971 bytes
Desc: not available
Url : http://www.antlr.org/pipermail/antlr-interest/attachments/20061125/3cd95bef/attachment-0001.obj 


More information about the antlr-interest mailing list