Hi William et at,

The good news is the parser can read the 16f877 device file, process &
dump it and the output is almost compilable.

The 'almost' is the compication:
 include chipdef_jallib
 pragma target chip 16f877a
The parameters of the two above do not fall into a proper lex
category. For include this example does, but it could have a '/'
(which can be handled) and could start with a number. And that's also
the issue with target chip.
The general rule of the lex analyser is: if it starts with a letter,
it is an identifier. If it starts with a number, it is an constant. So
by the time it reaches the parser, these parameters are already
converted into more then one token. For now, the parser accepts this
and the next level of code has to deal with this, but this is a bit of
a hack. Don't know if this is my limited knowledge of altlr or a quirk
in the JAL language...

Something else is the result of the parser: it seems to provide a
'flat tree' with 5252 nodes while I would expect to find the knowledge
on the structure provided by the grammar, so a tree and (also) encoded
tokens. I'll dig into this, but any advice is appreciated!

Joep

2010/4/10 William <[email protected]>:
> Greetings Joep,
>
> I'm found that I generally re-write programs at least 3 times before I
> begin to be satisfied with an approach.  So-- feel free to rewrite any
> of the grammar as you see fit.
>
> Also, next time you're in the neighborhood, feel free to add the usual
> JALLIB boiler-plate and your name to the author's list.
>
> Thank you for your help!
>
> William
>
> --
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/jallib?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to