Click here to Skip to main content
15,882,803 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralI think I might be in trouble Pin
k505424-Nov-23 12:13
mvek505424-Nov-23 12:13 
GeneralRe: I think I might be in trouble Pin
PIEBALDconsult24-Nov-23 13:49
mvePIEBALDconsult24-Nov-23 13:49 
GeneralRe: I think I might be in trouble Pin
honey the codewitch24-Nov-23 14:24
mvahoney the codewitch24-Nov-23 14:24 
GeneralRe: I think I might be in trouble Pin
Amarnath S24-Nov-23 19:34
professionalAmarnath S24-Nov-23 19:34 
GeneralRe: I think I might be in trouble Pin
Gary Stachelski 202125-Nov-23 6:12
Gary Stachelski 202125-Nov-23 6:12 
GeneralRe: I think I might be in trouble Pin
jschell25-Nov-23 7:17
jschell25-Nov-23 7:17 
Generalworldle 672 2/6 Pin
jmaida24-Nov-23 8:45
jmaida24-Nov-23 8:45 
GeneralRuminations on parsing. Pin
honey the codewitch23-Nov-23 17:01
mvahoney the codewitch23-Nov-23 17:01 
Probably a lot of you did this in school:

You take a context-free-grammar in some variant of BNF or EBNF and you use it to generate parse tables you can use to parse structured text, like programming languages.

After studying it off and on for years, teaching myself the concepts, building code generators, and using parser code generators already out there, I've come to the following conclusions:

1. For any non-LL(1) language of non-trivial complexity - say, a programming language for example, it is virtually always worth it to hand roll your own parser, as the code can be as much as an order of magnitude smaller, and more flexible, which since even languages with simplistic syntax like C still require dynamic introduction of symbols into the parse table while parsing, is pretty much required to parse something real world that is more than simple.

2. Even given #1 it may be worth it to use generated code to test hand rolled code, and to create a context free grammar to describe that language anyway. A grammar coded by a parser generator can test your hand rolled parser for correctness, and that CFG (grammar) can be used to document it.

3. Despite its power, bottom up parsing is not as elegant as top down parsing, and also #1 still applies, and you cannot realistically make a bottom up parser without generating it.

4. I spent a long time to come up with the above 3 little points. It was expensive, even as experience goes. I'm still trying to decide if it was worth it, all told, when I factor in how much computer science I learned in the process. I didn't get saddled financially for it though, so yay for that.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Ruminations on parsing. Pin
Daniel Pfeffer23-Nov-23 20:47
professionalDaniel Pfeffer23-Nov-23 20:47 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch23-Nov-23 23:37
mvahoney the codewitch23-Nov-23 23:37 
GeneralRe: Ruminations on parsing. Pin
Bruno van Dooren23-Nov-23 21:57
mvaBruno van Dooren23-Nov-23 21:57 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch23-Nov-23 23:35
mvahoney the codewitch23-Nov-23 23:35 
GeneralRe: Ruminations on parsing. Pin
Bruno van Dooren24-Nov-23 0:48
mvaBruno van Dooren24-Nov-23 0:48 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch24-Nov-23 4:34
mvahoney the codewitch24-Nov-23 4:34 
GeneralRe: Ruminations on parsing. Pin
jschell24-Nov-23 2:38
jschell24-Nov-23 2:38 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch24-Nov-23 4:37
mvahoney the codewitch24-Nov-23 4:37 
GeneralRe: Ruminations on parsing. Pin
Richard Andrew x6424-Nov-23 10:22
professionalRichard Andrew x6424-Nov-23 10:22 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch24-Nov-23 12:00
mvahoney the codewitch24-Nov-23 12:00 
GeneralRe: Ruminations on parsing. Pin
Mircea Neacsu24-Nov-23 13:32
Mircea Neacsu24-Nov-23 13:32 
GeneralRe: Ruminations on parsing. Pin
jschell25-Nov-23 6:52
jschell25-Nov-23 6:52 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch25-Nov-23 7:32
mvahoney the codewitch25-Nov-23 7:32 
GeneralRe: Ruminations on parsing. Pin
jschell27-Nov-23 5:47
jschell27-Nov-23 5:47 
GeneralRe: Ruminations on parsing. Pin
jschell25-Nov-23 6:48
jschell25-Nov-23 6:48 
GeneralRe: Ruminations on parsing. Pin
honey the codewitch25-Nov-23 7:27
mvahoney the codewitch25-Nov-23 7:27 
GeneralRe: Ruminations on parsing. Pin
jschell27-Nov-23 5:49
jschell27-Nov-23 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.