jdgamache has asked for the wisdom of the Perl Monks concerning the following question:

I've been thinking about writting a scripting language. I want to write my first version in Perl,and futur versions in C. I've written a few specs and my problem seems to be in the parsing of a the code. Anybody has some directions to help me ... a book or something. thanks!

Replies are listed 'Best First'.
Re: my own scripting language
by btrott (Parson) on Jan 17, 2001 at 02:21 UTC
    You need a parser. And if you do intend to eventually use C for your interpreter/parser/whatever, you'll probably want to use a grammar that's compatible with yacc.

    With that in mind, I think you should look at Dominus's py.

Re: my own scripting language
by stephen (Priest) on Jan 17, 2001 at 04:49 UTC
    Check out Constructing Language Processors for Little Languages by Randy M. Kaplan. It's a little rough going at times, and doesn't contain anything about application to Perl, but has some great stuff about how to design and implement scripting languages. You can take the stuff it says and apply it using yacc, yapp, or Parse::RecDescent. It contains examples of the kinds of grammars you'd need to write to use a parser generator.

    stephen

Re: my own scripting language
by Fastolfe (Vicar) on Jan 17, 2001 at 02:08 UTC
    If you can specify a thorough grammar for your language, perhaps something like Parse::RecDescent will be useful.
Re: my own scripting language
by clemburg (Curate) on Jan 17, 2001 at 14:18 UTC
A reply falls below the community's threshold of quality. You may see it by logging in.