NONMEM Users Network Archive

Hosted by Cognigen

[NMusers] Context-free lexer for NM-TRAN

From: Ruben Faelens <ruben.faelens_at_gmail.com>
Date: Thu, 14 Jun 2018 10:32:44 +0200

Hi all,

Calling all computer scientists and computer language experts.
In my spare time, I am working on a lexer and parser for NM-Tran. Primarly
to teach myself about grammars and DSL, but perhaps something useful will
come out of this (e.g. a context-sensitive editor with code completion).

When lexing, I am having a hard time describing the keywords used by
nm-tran.
Let us take '.EQ.' as an example.
1) It seems that *.EQ. *is a keyword used to describe a comparison.
2) However, a filename could also be 'foo.eq.bar'
The same thing applies for keywords on the '$ESTIMATION' record. These
keywords could also be used as variable names.

Am I right in saying that NM-TRAN cannot be tokenized with a context-free
lexer? And that I should focus my efforts on building a lexer-less parser?
(Or building my own lexer-parser, see
https://en.wikipedia.org/wiki/The_lexer_hack )
I assume building a parser for NM-TRAN was already done in the DDMoRe
project, but I failed to find the source code...

Kind regards,
Ruben Faelens


Received on Thu Jun 14 2018 - 04:32:44 EDT

The NONMEM Users Network is maintained by ICON plc. Requests to subscribe to the network should be sent to: nmusers-request_at_iconplc.com. Once subscribed, you may contribute to the discussion by emailing: nmusers@globomaxnm.com.