[PLUG-Devel] Profiling a new programming language

Ryan Rix phrkonaleash at gmail.com
Sat Nov 15 00:31:23 MST 2008


On Thu November 13 2008 07:33:33 am Darrin Chandler wrote:
> Once you've done that, you might want to put what you've got into a
> formal notation such as BNF. If you can define it well enough then you
> can turn to tools such as lex/flex & yacc/bison, which have been
> designed to generate parsing code from specs. If you can't define your
> language that well then you need to get to that point! Even if you end
> up not using C/lex/yacc!
>

So, I have a BNF, completely finished IMO (attached as well) but I'm not 
entirely sure what to do with it... I ran it through this haskellmabob, but 
it doesn't really 'do' anything (the source was empty as far as I could tell) 
but... :)

/me is lost

~Ryan on the way to bed... 

--
Thanks and best regards,
Ryan Rix
TamsPalm - The PalmOS Blog

JaneJane, we just blew past that stop sign and the cops are 
on our tail. What now? -- Recalculating destination...



-------------- next part --------------

# these are just useful
crlf		::= %x0a; #really just an LF but who's counting?
blank		::= [{' '|'\t'|'\n'|'\r'}];
digit 		::= %x30-39;
number		::= {digit};
letter		::= %d65-90 | %d97-102 | %d46;
symbol		::=  %x21-2f | %x3a-3f | %x5b-60 | %x7b-7e;
string		::= {letter};
string_sp	::= {letter | blank | expandme };
string_regex	::= {letter | blank | symbol | expandme};

comment	::= %x23 string_regex crlf; # all text after a # and before a crlf
expandme	::= "${" defid [{"," option}] "}"; #  this says "hey expand me, dude!" to a definition!

#these are main section identifiers
begindefine	::= "$define$";
enddefine	::= "$enifed$";
begintext	::= "$text$";
endtex		::= "$txet$";

# Definitions
definition	::= defid ":" deftype [{crlf defargs}] crlf [{arguments}];
defid		::= digit;
deftype		::= string;

# Arguments
arguments	::= ">" argument crlf;
argument	::= options | pattern | text | initval | computation;
options		::= "opts:" option [{","option}];
pattern		::= "pattern:" string_regex;
text		::= "text:" string_regex;
initval		::= "initval:" number;
computation	::= string_regex;

option		::= string
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.PLUG.phoenix.az.us/pipermail/plug-devel/attachments/20081115/e6384381/attachment.pgp 


More information about the PLUG-devel mailing list