Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jonathan Roewen <jonathan.roewen@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ocamllex+ocamlyacc and not parsing properly
Date: Mon, 8 Aug 2005 09:54:37 +1200	[thread overview]
Message-ID: <ad8cfe7e05080714542ffce11a@mail.gmail.com> (raw)
In-Reply-To: <ad8cfe7e050807143962166f9@mail.gmail.com>

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
> 
> 
>


  reply	other threads:[~2005-08-07 21:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-07 21:39 Jonathan Roewen
2005-08-07 21:54 ` Jonathan Roewen [this message]
2005-08-07 23:58 ` Jon Harrop
2005-08-08  2:17   ` Jonathan Roewen
2005-08-08  4:23     ` Jonathan Roewen
2005-08-08  5:03       ` Jonathan Roewen
2005-08-08  6:39         ` Jon Harrop
2005-08-08  6:47           ` Jonathan Roewen
2005-08-08  8:59       ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad8cfe7e05080714542ffce11a@mail.gmail.com \
    --to=jonathan.roewen@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox