Re: Parser generator (+ Lexer) that actually works?



On Jun 6, 2:01 am, Uwe Klein <uwe_klein_habertw...@xxxxxxxxxxx> wrote:
tom.rmadilo wrote:
On Jun 5, 11:28 am, "Gerald W. Lester" <Gerald.Les...@KnG-
Consulting.net> wrote:

Fredrik Karlsson wrote:

Hi,

I've been trying to get hold of a parser generator + lexer combination
that would give me a parser implemented in Tcl, that actually works.

My experience so far:

taccle + fickle - just outputs nothing. Even the demos fails to give
any ouput.
Yeti - I get bus error every time I use either the parser or the lexer
demos.

I am using UTF-8 encoding.. Are there other options out there that I
should try before continuing my current work of rolling my own parser
from scratch?

If you have control over the input language, how about using a safe interp
and letting the Tcl parser parse it for you.



I don't understand, if the Tcl parser can parse the language, wouldn't
it be Tcl?

Sure.

Then you really aren't talking about a new language to parse.

But even so, since the Tcl parser doesn't enforce command
structure, how does this end up working? There must be a simple
example of this concept, which would be very helpful if you don't
really need a flex/bison type generator.

The basic idea about tcl:
Being a  framework for most "domain specific language" instances
you could need,

Maybe there is some confusion about how tools like flex/bison or Yeti
are used and why. At best the Tcl parser is a tokenizer like flex.
Each command basically serves as its own parser. If the language has
any recursion, it would be, my guess, a very ugly language to
represent as Tcl code.

Or maybe not, but a specific example would clear things up...and help
others avoid the extra work of using a flex/bison type generator.
.



Relevant Pages

  • Re: Tcl parsing
    ... Tcl isn't the sort of ... > language that Yacc was designed to parse. ... > too simple - implying that a parser will give less ... but I need rooles for every single command. ...
    (comp.lang.tcl)
  • Re: Parser generator (+ Lexer) that actually works?
    ... that would give me a parser implemented in Tcl, ... Yeti - I get bus error every time I use either the parser or the lexer ... you define a set of Tcl commands that provide the ... language is what I would call an API. ...
    (comp.lang.tcl)
  • Re: Passing literal strings to Tcl_Eval.
    ... the parser is looking for arguments. ... The next character puts ... With Tcl, the options are few in number. ... you don't you probably aren't experimenting enough, ...
    (comp.lang.tcl)
  • Re: Parser generator (+ Lexer) that actually works?
    ... that would give me a parser implemented in Tcl, ... Yeti - I get bus error every time I use either the parser or the lexer ... I don't understand, if the Tcl parser can parse the language, wouldn't ... you define a set of Tcl commands that provide the ...
    (comp.lang.tcl)
  • Re: Parser generator (+ Lexer) that actually works?
    ... that would give me a parser implemented in Tcl, ... Yeti - I get bus error every time I use either the parser or the lexer ... If you have control over the input language, how about using a safe interp ... and letting the Tcl parser parse it for you. ...
    (comp.lang.tcl)