denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] lexer states


From: Richard Shann
Subject: [Denemo-devel] lexer states
Date: Mon, 09 Aug 2010 08:42:58 +0100

We may need to switch states in the lexer to parse the mxml2ly output.
Just in case I have done some reading.

I have just read up section 4.2.1 of the Silex manual about multiple
lexers. This seems quite straight-forward (for handling states in the
lexer.ll). What you do is to create a silex spec file for each state 
(e.g. the longcomment state if we need it would have a - quite simple -
lexer spec file that looks for %}) then use the (lex ...) procedure to
create the table for that analyser.
Then these tables and multilex.scm are loaded and you make separate
input systems (lexer-make-IS ...)
and finally create a lexer for the table and input system IS
with  (lexer-make-lexer ...)

the switch from using one lexer to the other as lalr operates is
something I haven't studied yet.

Richard





reply via email to

[Prev in Thread] Current Thread [Next in Thread]