Re: Script Parser



CJReilly@xxxxxxxxx wrote:
I am trying to build a simple script parser with basic-like syntax and
including the standard loops, variables, if/else statements, and such
found in most core languages.

I was hoping someone could point me to a good resource. I've tried
searching for books and articles online, but no luck. :-( Unfortunately
my comp. sci. class voted against the script parser lesson.

- Chris

Any language that is to make it (that is, do what it is designed to
do), is going to have to have a grammar associated with it. Once the
grammar is built, there needs to be a tool that, based on that grammar,
will parse the input (either all at one or one token at a time) and
generate code or errors accordingly.
Fortunately, there are tools that work together. Lex (or Flex) and Yacc
are two such tools. Originaly, you had to have a strong grasp on the C
language, but these tools have been ported to other languages as well.
google : Lex and Yacc
For further details.

Once you have that down - the grammar and parsing - you will probably
want to look into things such as call stacks and symbol tables.

OT:
Kudos to you for wanting to learn more than you are being taught. THe
fact you may never use this language once you are done doesn't change
the benefit you'll get from the experience. Having to design your own
language provides insignt into the design of other languages that most
site as 'annoyances'.

.



Relevant Pages

  • Re: Related languages (Re: A China-Sumer connection)
    ... >> language in everyday use that heh, ... > distinction between pidgin and creole must be based on grammar. ... "I'd gone out to the store" is proper English to say what I did ... They can learn to say words, but not communicate. ...
    (sci.archaeology)
  • Re: Related languages (Re: A China-Sumer connection)
    ... >> language in everyday use that heh, ... > distinction between pidgin and creole must be based on grammar. ... "I'd gone out to the store" is proper English to say what I did ... They can learn to say words, but not communicate. ...
    (sci.anthropology)
  • Re: Related languages (Re: A China-Sumer connection)
    ... >> between pidgin and creole must be based on grammar. ... > grammar based on a language from group A and they would place the ... > being based on the grammar of the languagethey already speak, ... > how the different varieties of English come about: ...
    (sci.anthropology)
  • Re: Related languages (Re: A China-Sumer connection)
    ... >> language in everyday use that heh, ... > distinction between pidgin and creole must be based on grammar. ... "I'd gone out to the store" is proper English to say what I did ... They can learn to say words, but not communicate. ...
    (sci.lang)
  • Re: Related languages (Re: A China-Sumer connection)
    ... >> between pidgin and creole must be based on grammar. ... > grammar based on a language from group A and they would place the ... > being based on the grammar of the languagethey already speak, ... > how the different varieties of English come about: ...
    (sci.lang)