|
Yes, I once experimented with lex and Yacc but I just couldn't find enough real world examples of "scripts" for them. I understood BNF, but not how to use lex and yacc.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
lex and YACC are hard.
if i gave you a simple ruleset that's basically really stripped BNF, you might get it, eh?
How about
E -> E + T | T
T -> T * F | F
F -> ( E ) | int
or longhand
E -> E + T
E -> T
T -> T * F
T -> F
F -> ( E )
F -> int
This represents a very simple expression grammar with positive ints, +, * and () supported
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.
|
|
|
|
|
Well, I did understand it at the time. Only by now I have forgotten it all. <nervous laugh>
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
well that's a variant. I mean, things like XBNF are a lot friendlier but the computer can't do much with them directly.
how about if i pretty it up some and put it in xbnf?
expr= expr "+" term | term;
term= term "*" factor | factor;
factor= "(" expr ")" | int;
it works using substitution. Every time it finds either "term" or "expr" "+" "term" it replaces that with "expr"
(note it's cyclical here, that makes a loop)
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.
|
|
|
|
|
Ah yes, I see. Each successive line defines the symbol that was declared on the line above it?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
in this case yes, but not necessarily. They can be in any order. They do reference each other though and that's how you figure out what replaces what
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.
|
|
|
|
|
Back when I was in undergraduate school, lexical analysis and compiler design were all taught in Computer Science. They don't seem to do that much anymore, though.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Ain't that the truth. Now it's only about learning how "to code".
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
i never went to school for it. I wound up at microsoft at 18 instead. But compilers and parsers have always been an interest of mine.
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.
|
|
|
|
|
Isn't the Roslyn compiler open source?
And maybe Honey can contribute
|
|
|
|
|
A bug in Microsoft's CodeDOM for the VB language forced me to change my code if I wanted to support VB.
Well, I feel like i need a shower, but the next rev will support VB code generation
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.
|
|
|
|
|
If changing your code so it works with VB feels like you need a shower, just wait until you write actual VB code to test it out.
Bring out the peroxide and pressure washer.
|
|
|
|
|
i have a "friend" i can fob that off on. poor guy
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.
|
|
|
|
|
Okayyyy...You've already said more than enough.
|
|
|
|
|
Sometimes I accidentally leave my project in "Release" configuration, and I barely notice or don't notice at all.
The debugger attaches, breakpoints hit, and unlike C++ I have the entire stack frame and everything else at my fingertips, in C#, just like in debug mode.
There's very little actual code optimization done at this phase, or at least that used to be the case, and based on a little test @Super Lloyd (don't know how to tag here) ran some time back still seems to be. This is perhaps Microsoft's dirty little secret, they don't do much whole program optimization.
But mostly, the debugger works great because all the type information is there, even release, so you have the offsets of every member, and all the names.
It almost raises the question of why bother even having debug mode in .NET aside from conditional compiles (#define DEBUG) and metadata attributes related to it.
I think i may have hit a snag hitting a breakpoint in some scenarios but most of the time everything just works.
Not that I recommend this. I just find myself in release without noticing for awhile because of it.
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.
|
|
|
|
|
With C#, I do both debug and release modes with full debug info.
|
|
|
|
|
honey the codewitch wrote: don't know how to tag here
It's pretty simple.
In many cases you can just use an "@", followed by the username: @OriginalGriff
And the system will replace it with the link, and send the email as it did with me.
But yours is harder: @honey the codewitch won't work, because that isn't what you started with, and it contains spaces. So I go to your homepage, and below your username is the correct code: @code-witch
For Super Lloyd, you do the same thing, and get @Super-Lloyd which is who you were trying to acknowledge.
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!
|
|
|
|
|
thanks
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 know the hamsters are on the pish 24/7, but does it really take 12 years to send a welcome email?
veni bibi saltavi
|
|
|
|
|
Postage strike?
cheers
Chris Maunder
|
|
|
|
|
Hi, Nagy, good to see you on here again. Has your supply of Gin run out? Are you going to ask for donations?
CQ de W5ALT
Walt Fair, Jr.PhD P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Is an owl that does magic tricks Hoodini?
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!
|
|
|
|
|
My owl is from Las Vegas, and I call him Sigfried.
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
That's owlful.
The Beer Prayer - Our lager, which art in barrels, hallowed be thy drink. Thy will be drunk, I will be drunk, at home as it is in the tavern. Give us this day our foamy head, and forgive us our spillage as we forgive those who spill against us. And lead us not to incarceration, but deliver us from hangovers. For thine is the beer, the bitter and the lager, for ever and ever. Barmen.
|
|
|
|
|
Yeah - but it's a hoot!
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!
|
|
|
|