Click here to Skip to main content
14,606,278 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.
 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 3:59
mvahoney the codewitch3-Jan-20 3:59 
GeneralRe: In defense of goto Pin
Member 79891223-Jan-20 4:54
MemberMember 79891223-Jan-20 4:54 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 4:58
mvahoney the codewitch3-Jan-20 4:58 
GeneralRe: In defense of goto Pin
Member 79891223-Jan-20 5:27
MemberMember 79891223-Jan-20 5:27 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 5:29
mvahoney the codewitch3-Jan-20 5:29 
GeneralRe: In defense of goto Pin
pkfox3-Jan-20 1:24
professionalpkfox3-Jan-20 1:24 
GeneralRe: In defense of goto Pin
Member 79891222-Jan-20 22:43
MemberMember 79891222-Jan-20 22:43 
GeneralRe: In defense of goto Pin
honey the codewitch2-Jan-20 22:50
mvahoney the codewitch2-Jan-20 22:50 
one issue with this approach: It works for k=2, but not k=n.

The issue is the index.

The number of symbols in a viable prefix (k) is arbitrary but known at generation time

but my generated code needs to work for k=whatever regardless of the overarching machine/code size.

I can compact the table in a recursive descent parser by only extending k where necessary. in the functions where k=1 (most of them) none of this is necessary.

But i can't use an actual table to begin with.

To understand why you'd have to understand Parsley. It generates recursive descent composition parsers. Basically it creates a series of recursive descent parsers that share the same symbol table and lexer and can call each other.

Now, I could handle this using tables, sort of (tables have a hard time delegating to other tables when parsing) but i could do it.

But what I couldn't handle is virtual non-terminal productions, which allow someone to completely take over the parse.

The reason i can't use tables there is it increases the complexity of the code that exists in the grammar (the end user's code) to a point where it's not feasible. Tables aren't intelligible if they're cooked and machine generated, but this has to be.

I can only refer you to using Parsley in a real world scenario in hopes to illustrate the problem further. If you understand how to use Parsley you should understand why this approach probably won't work, unless i'm missing something.

Parse Anything with Parsley: A Different Approach[^]
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.

GeneralRe: In defense of goto Pin
jsc422-Jan-20 23:15
professionaljsc422-Jan-20 23:15 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 5:05
mvahoney the codewitch3-Jan-20 5:05 
GeneralRe: In defense of goto Pin
Member 79891223-Jan-20 0:14
MemberMember 79891223-Jan-20 0:14 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 3:56
mvahoney the codewitch3-Jan-20 3:56 
GeneralRe: In defense of goto Pin
Member 79891223-Jan-20 5:16
MemberMember 79891223-Jan-20 5:16 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 5:23
mvahoney the codewitch3-Jan-20 5:23 
GeneralRe: In defense of goto Pin
glennPattonWork2-Jan-20 23:13
professionalglennPattonWork2-Jan-20 23:13 
GeneralRe: In defense of goto Pin
Member 79891223-Jan-20 0:35
MemberMember 79891223-Jan-20 0:35 
GeneralRe: In defense of goto Pin
glennPattonWork3-Jan-20 0:41
professionalglennPattonWork3-Jan-20 0:41 
GeneralRe: In defense of goto Pin
Member 79891223-Jan-20 1:32
MemberMember 79891223-Jan-20 1:32 
GeneralRe: In defense of goto Pin
Rick York3-Jan-20 5:02
mveRick York3-Jan-20 5:02 
GeneralRe: In defense of goto Pin
Mark_Wallace2-Jan-20 23:48
MemberMark_Wallace2-Jan-20 23:48 
GeneralRe: In defense of goto Pin
honey the codewitch3-Jan-20 4:01
mvahoney the codewitch3-Jan-20 4:01 
GeneralRe: In defense of goto Pin
Mark_Wallace3-Jan-20 19:58
MemberMark_Wallace3-Jan-20 19:58 
GeneralRe: In defense of goto Pin
Greg Utas3-Jan-20 1:44
professionalGreg Utas3-Jan-20 1:44 
GeneralRe: In defense of goto Pin
H.Brydon4-Jan-20 16:21
professionalH.Brydon4-Jan-20 16:21 
GeneralRe: In defense of goto Pin
honey the codewitch4-Jan-20 17:00
mvahoney the codewitch4-Jan-20 17:00 

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.