My parser is for assembler, here is lex and bison files just in case
https://bitbucket.org/Pugnator/zcore/src/28c783d1f860c001faed2b44076d3fbc83b42c6f/src/macroasm/z80.lex?at=asm
https://bitbucket.org/Pugnator/zcore/src/28c783d1f860c001faed2b44076d3fbc83b42c6f/src/macroasm/asm.y?at=asm
in this example all works like a charm:
|nop
nop
nop
|
Here is debug output
|--accepting rule at line 154 ("nop")
--accepting rule at line 248 ("
")
--accepting rule at line 154 ("nop")
--accepting rule at line 248 ("
")
--accepting rule at line 154 ("nop")
--accepting rule at line 248 ("
")
--(end of buffer or a NUL)
--accepting rule at line 248 ("
")
--(end of buffer or a NUL)
--EOF (start condition 0)
|
The problem raise when I try to parse this code (rule is at line 255 in
lex file)
|DEFB '?'+$80
DEFM "RN"
DEFB 'D'+$80
|
It backs up forever and looks like it can't reach newline (I have a rule
for it). I generated backup file
http://pastebin.com/UW8zct3h
from flex, but can't understand how to use it in order to find the root
cause.
|--accepting rule at line 255 ("DEFB")
--accepting rule at line 280 (" ")
--accepting rule at line 280 (" ")
--accepting rule at line 280 (" ")
--accepting rule at line 280 (" ")
--(end of buffer or a NUL)
--scanner backing up
--accepting rule at line 105 ("'?'")
--accepting rule at line 233 ("+")
--accepting rule at line 56 ("$80")
|
_______________________________________________
help-flex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-flex