Browse thread
Re: The lexer hack
-
Jeff Shaw
-
Dario Teixeira
-
Francois Pottier
-
Dario Teixeira
-
Martin Jambon
- Dario Teixeira
-
Martin Jambon
-
Dario Teixeira
-
Francois Pottier
-
Dario Teixeira
[
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: | 2009-11-14 (18:19) |
From: | Dario Teixeira <darioteixeira@y...> |
Subject: | Re: [Caml-list] Re: The lexer hack |
Hi, > If the lexer to use can be determined by only one token > (BEGIN_VERB), I think you can change the state in the lexer > like this: Unfortunately the language features some verbatim-like environments where choosing the right scanner entails knowing more about the context than what is available to the lexer. As an example, in the command \link{url}{text}, the "url" should be interpreted verbatim, whereas the "text" portion uses the general scanner. The parser is fully aware of the context, of course, which is why the "dummy action" solution worked fine. (And yes, I thought of having different delimiters for different scanning contexts, but in many ways it would make the language more cumbersome for the user). Cheers, Dario Teixeira