|a newbie's dumb question... email@example.com (2001-07-18)|
|Re: a newbie's dumb question... firstname.lastname@example.org (Vinay Kakade) (2001-07-23)|
|Re: a newbie's dumb question... email@example.com (Joachim Durchholz) (2001-07-23)|
|Re: a newbie's dumb question... firstname.lastname@example.org (2001-07-23)|
|Re: a newbie's dumb question... email@example.com (ThaFacka) (2001-07-23)|
|Re: a newbie's dumb question... firstname.lastname@example.org (2001-07-27)|
|Re: a newbie's dumb question... email@example.com (James Grosbach) (2001-07-30)|
|Date:||27 Jul 2001 02:53:33 -0400|
|Posted-Date:||27 Jul 2001 02:53:33 EDT|
Another way to look at this is to focus on why you are considering a
grammar tool in the context of PIC micros. If your interest is the PIC
assembly language and the various classes of devices, then the
executables are already available from the vendor.
So one presumes that the interest is part academic or
self-development, thus the valance an this inquiry is probably the
oposite. The PIC devices are a very ideal target for someone focusing
on lexers and parsers for the first time!
Your error recovery considerations might be eased if you recognize
from the start that the topology of an assembler language for these
devices has very few acceptable patterns.
In all probability you can legitimately impose a
single-line-single-instruction requirement on the source code, and
then accept about four basic line patterns:
comment only lines
lines with commands only
lines with command and comments.
You could handle the blank lines in the lexer; and if you choose to exploit
states, even the comment only lines could be trifles for the lexer.
That leaves only a couple of things for the parser to munch on
optional-label command destination, source
then you could deploy a few obvious error production rules like
The exact value of the PIC devices as targets is that you can get reasonable
quickly to the real chores of compiler development, without beign bogged down
in infinitely recursive language syntax.
Your basic decision will be to design the productions as immediate code
generators on the fly, or to design the productions as syntax tree constructors
with judiciously triggered tree walkers as the code generators.
Return to the
Search the comp.compilers archives again.