|
MOST OF US ARE HERE ALREADY.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
honey the monster, codewitch wrote: i will BRING ALL THE NERDS Did you ever hear about someone bringing owls to Athens?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
who?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
You, in this case. We have a shortage of nerds here, just as Athens always had a shortage of owls[^].
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
|
honey the monster, codewitch wrote: i will BRING ALL THE NERDS
In other news, more chocolate offerings at Willy Wonka's chocolate factory
|
|
|
|
|
I've broken up the different parser / lexer generator tasks into console accessible operations
so - if you want to take an XBNF document
like this
grammar<start>= productions;
productions<collapsed> = production productions | production;
production= identifier [ "<" attributes ">" ] "=" expressions ";";
expressions<collapsed>= expression { "|" expression };
expression= { symbol };
symbol= literal | regex | identifier |
"(" expressions ")" |
"[" expressions "]" |
"{" expressions ("}"|"}+");
...
and turn into a pck spec (which you have to do before you can do much else with it)
grammar:start
productions:collapsed
expressions:collapsed
symbollist:collapsed
attributelisttail:collapsed
grammar-> productions
productions-> production productions
productions-> production
production-> identifier lt attributes gt eq expressions semi
production-> identifier eq expressions semi
expressions-> expression expressionlisttail
expressions-> expression
expression-> symbollist
expression->
symbol-> literal
symbol-> regex
symbol-> identifier
symbol-> lparen expressions rparen
symbol-> lbracket expressions rbracket
symbol-> lbrace expressions rbrace
symbol-> lbrace expressions rbracePlus
...
you'd use the command line like
pckw xlt xbnf.xbnf xbnf.pck
now, before you can use it with an LL(1) parser (including mine, or say Coco/R) you have to "factor" it
from the command line
pckw ll1 xbnf.pck xbnf.ll1.pck
you can then generate the code for it or export it whatever
pckw fagen xbnf.ll1.pck XbnfTokenizer.cs
pckw ll1gen xbnf.ll1.pck XbnfParser.cs
or you can pipe these operations. Like, turn an xbnf grammar into a parser:
pckw xlt xbnf.xbnf /transform xbnfToPck | pckw ll1 | pckw ll1gen /class XbnfParser > XbnfParser.cs
My question is, is this too much BS?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the monster, codewitch wrote: My question is, is this too much BS? Not at all. Would like to someday try out the tools you're building if you happen to post them as individual articles. Thanks.
/ravi
|
|
|
|
|
They're getting posted as one. It's actually one executable: pckw above.
there's a bunch of libraries that make it work though. several projects.
the nice thing at least, is each individual command is segregated into its own source file (except for some shared bits) so it's easy to separate what's going on with each command.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Does it work as a filter?
|
|
|
|
|
there are currently no transformations in there that filter, but it could. I just don't know what you would filter. If there was a reason, then yes, one of these pipe operations would filter, but what they usually do is transform data from one form to another. (from a parser spec to a code file for example)
It works as a pipeline of transformations essentially. Imagine XSLT except not, and you could pipe them together.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I don't know the last time I made one of these all it did was spit out messages like
"Everything is going to be ok"
"You'll do better next time"
"There are plenty of other fish in the sea"
It was a true "console" application.
|
|
|
|
|
hahaha
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the monster, codewitch wrote:
grammar-> productions
productions-> production productions
productions-> production
production-> Wow!
That's almost Java!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
it's actually not a programming language at all, but a grammar, and it's presented in a really common format for grammars, that's sort of pseudo-bnf.
You can feed it to parser generators LL(1) Parser Generator. First, Follow, & Predict Sets. Table[^]
To make parsers with it.
Hacking off isn't the only website that supports this format. Other tools and sites will too, or will with slight variations.
I wish there was a name for the format. It's very similar to a .y file format (YACC)
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the monster, codewitch wrote: is this too much BS? Not at all, but is the Lounge the right place for it ?
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
honey the monster, codewitch wrote: My question is, is this too much BS?
The Linux geeks will love it!
|
|
|
|
|
that was my thinking. frankly, i like the flexibility. Command line apps are the easiest to integrate with other tools.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Is bunny an abundance of bread rolls?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
That's a rabbit of humor, indeed! Glad to hare about it.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
coz bread like rabbits?
Message Signature
(Click to edit ->)
|
|
|
|
|
|
|
I've tested pck and it works
currently exports to yacc and lex as well as being a parser generator in its own right.
I intend to add more importers and exporters to the thing.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|