Browse thread
[Caml-list] ocamllex+ocamlyacc and not parsing properly
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jonathan Roewen <jonathan.roewen@g...> |
| Subject: | Re: [Caml-list] ocamllex+ocamlyacc and not parsing properly |
> So you're lexer is emitting the tokens str, com, str, com, str, eol but your > parser looks as though it is expecting str, com, str, str, str, eol. > > I'm guessing the error is in the lexer because the grammar in the parser is > very simple. So ":Sovereign.Wyldryde.org" is lexed by "message" into str, " " > then invokes "command" which parses 254 into com, " " then invokes "param" > which parses "dst" into str, "param" then invokes the remaining into strs. > > However, that can't be correct because the lexer has clearly gone back into > "command" in order to emit "Irc_types.Numeric 112". > > It's just a guess, but have you assumed that each time the lexer is invoked by > the parser that it starts in the rule it was left in when, in fact, the > parser invokes the "message" rule every time? Yes, I assume it continues lexing where it left off. If this is not the case, what's the best way to do conditional parsing?? Jonathan