Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocamllex+ocamlyacc and not parsing properly
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ 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
I should add what the expected format of the IRC string is:

[':' <from> <space>] <command> { <space> <param> } [ <space> ':'<last-param> ]

from := letters not including space
command = digit digit digit OR uppercase letters only
param = letters not including spaces
last-param = any letters including spaces

Jonathan

On 8/8/05, Jonathan Roewen <jonathan.roewen@gmail.com> wrote:
> Hi,
> 
> I'm having some trouble with a lexer+parser I've written to parse IRC
> strings. Just about all strings are parsed correctly, but I'm having a
> few minor issues.
> 
> Here are two strings that fail to parse correctly:
> :Sovereign.Wyldryde.org 254 dst 112 :holodeck programs running
> 
> :Sovereign.Wyldryde.org 333 dst #bfos Helio 112025589
> 
> My irc_lexer.mll & irc_parser.mly are attached :-) (don't wanna spam
> the list with huge lines of code)
> 
> Used in ircii.ml as:
> 
> let input_line = IO.read_line instream in
>  try match (Irc_parser.args Irc_lexer.message (Lexing.from_string
> input_line)) with
> 
> If someone can highlight what's going wrong, I'd really appreciate it
> (though, it doesn't currently affect any received irc commands of
> great significance at the moment).
> 
> BTW: As an aside, if the lexer doesn't cover all the bases, it doesn't
> throw an exception, just screws up my OS (Bounds check error, followed
> by seg-fault).
> 
> Jonathan
> 
> 
>