Parser

new topic     » topic index » view thread      » older message » newer message

I have recently wrote a parser which reads in a file and turns it into a 
stream of tokens.

A file containing:

     hello world 123 456 'comment
    'c' "hello"

would return

   {{ID, "hello", 1},         -- {Token description (constant), token 
string, line number}
    {ID, "world", 1},
    {NUM, "123", 1},
    {NUM, "456", 1},
    {CHR, 'c', 2},
    {STR, "hello", 2}}

The characters for comments, chars, strings etc. can be set.  However, they 
can only be single chars.

Does anyone have any other ideas for it before I finish it off and upload it 
to the archive?

Thanks

_________________

StewartML

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu