Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Olivier Pons <opons@aenegada.inria.fr>
To: caml-list@inria.fr
Subject: lexer function .
Date: Thu, 31 Oct 1996 11:25:48 +0100 (MET)	[thread overview]
Message-ID: <199610311025.LAA08481@aenegada.inria.fr> (raw)



	hello !


I have a little problem with the lexer function generated by make_lexer
in the example below:

   let lexer = make_lexer ["("; ")"; "/\\"; "\//"; "~"; "->"];; 

   let a =  (lexer(stream_of_string"a/\~a"));; (* there is no blank*)
   a : token stream = <abstr>
   #let b = (lexer(stream_of_string"a/\ ~a"));;(* there is a blank*)
   b : token stream = <abstr>

and now I just inspect  the token stream generated

   #stream_next a;;                                              
   - : token = Ident "a"
   #stream_next b;;                            
   - : token = Ident "a"

but in the next call 

   #stream_next a;;
   - : token = Ident "/\\~"

   #stream_next b;;
   - : token = Kwd "/\\

   #stream_next a;;
   - : token = Ident "a"

   #stream_next b;;
   - : token = Kwd "~"
   .......

I don't understand why in the first case the keywords /\\ and ~  are not recognized ?

thank in advance


Olivier






             reply	other threads:[~1996-10-31 15:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-31 10:25 Olivier Pons [this message]
1996-11-04 16:45 ` Xavier Leroy

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=199610311025.LAA08481@aenegada.inria.fr \
    --to=opons@aenegada.inria.fr \
    --cc=caml-list@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