caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: 沈胜宇 <syshen@nudt.edu.cn>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] [OCAML]:: how to switch buffer in ocamllex?
Date: Wed, 25 Nov 2015 16:30:05 +0100	[thread overview]
Message-ID: <1448465405.23576.13.camel@e130.lan.sumadev.de> (raw)
In-Reply-To: <3796b53d.4c21.1513ef59b69.Coremail.syshen@nudt.edu.cn>

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]

Am Mittwoch, den 25.11.2015, 22:04 +0800 schrieb 沈胜宇:
> Dear all:
> 
> I am using ocamllex to write a lexer, the language I am analyzing have
> "include" mechanism that refer to another file.
> 
> So how can I open the refered file and switch to it in ocamllex?

Just open it with Lexing.from_file, and recursively call the lexer from
itself.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
My OCaml site:          http://www.camlcity.org
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
------------------------------------------------------------


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      parent reply	other threads:[~2015-11-25 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 14:04 沈胜宇
2015-11-25 14:24 ` Soegtrop, Michael
     [not found]   ` <13dd7e2d.1043.1518465adb0.Coremail.syshen@nudt.edu.cn>
2015-12-09  8:42     ` Soegtrop, Michael
     [not found]       ` <1d2e3f25.10d7.15185feb280.Coremail.syshen@nudt.edu.cn>
2015-12-09 10:05         ` Soegtrop, Michael
2015-11-25 15:30 ` Gerd Stolpmann [this message]

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=1448465405.23576.13.camel@e130.lan.sumadev.de \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=syshen@nudt.edu.cn \
    /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;
as well as URLs for NNTP newsgroup(s).