On Apr 28, 11:24 pm,
esmithm...@gmail.com wrote:
> ... Trying to define subsets of {Printable} and {Letter}
> that exclude lowercase a-z.
Er -- my grammar (to date) can be seen here:
http://www.nutstreet.net/prog/avr/basic/BASIC-64avr.html
This is a "hybrid" of the BASIC-64 and Commodore Pet BASIC grammars
found on the GOLD website, with some minor changes. I used primarily
the BASIC-64 grammar but added the <Value> definition from the Pet
grammar in order to add basic functions (INT, SQR, etc). I _tried_ to
do this on my own before I had seen the Pet example, and was really
pulling my hair out. It didn't occur to me to put it in the <Value>
definition. Gee, some aspects of this seem so straightforward, but
this certainly wasn't for me. At first I tried adding the function
definitions as part of <Expression>, and what at first seemed ok --
would parse
10 X=SQR(Y)
and
10 X=SQR(SQR(Y))
but would not parse
10 X=SQR(Y)+SQR(Z)
So, I looked around for examples and found the GOLD site Pet grammar
which had these functions. I added the <Sub Exp> definition and
replaced my <Value> with the Pet one, and now the grammar I'm working
on will parse.
But I don't want to have the lower case -- my hardware (an ATmega644)
is currently programmed to turn everything into uppercase (I've
already written the input system, memory management, and even an
EEPROM "filesystem". Now I'm working on the parser) -- and since I'm
doing that I wanted to setup the grammar to only deal with uppercase.
But I can't figure out how to modify the {Letter} and {Printable}
definitions to do so. Presumably I need to subtract something, but I
keep seeing both the upper- and lowercase letters in the DFA state
tables.
So I'm wanting to create something like an {Upper Printable} and
{Upper Letter} (again, presumably by subtracting something from
{Printable} and {Upper}) -- but if someone could please _show_ me how
to do that, it would certainly be a huge help...I'm really having
trouble with it.
Thanks,
Eric kd5uwl
ps THANK YOU to the developer(s) of GOLD -- absolutely amazing.