Click here to Skip to main content
14,573,754 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: OK. Who forgot to feed the meter? Pin
OriginalGriff22-Feb-20 9:14
mveOriginalGriff22-Feb-20 9:14 
GeneralRe: OK. Who forgot to feed the meter? Pin
Cp-Coder22-Feb-20 9:18
MemberCp-Coder22-Feb-20 9:18 
JokeRe: OK. Who forgot to feed the meter? Pin
Daniel Pfeffer22-Feb-20 8:21
professionalDaniel Pfeffer22-Feb-20 8:21 
GeneralRe: OK. Who forgot to feed the meter? Pin
Mark_Wallace22-Feb-20 17:17
MemberMark_Wallace22-Feb-20 17:17 
GeneralRe: OK. Who forgot to feed the meter? Pin
Daniel Pfeffer22-Feb-20 20:28
professionalDaniel Pfeffer22-Feb-20 20:28 
GeneralEdit and continue broken in Visual Studio 2019 (.net 3.5, VB.NET Winforms) Pin
chris5gd22-Feb-20 4:34
Memberchris5gd22-Feb-20 4:34 
GeneralRe: Edit and continue broken in Visual Studio 2019 (.net 3.5, VB.NET Winforms) Pin
PIEBALDconsult22-Feb-20 9:35
professionalPIEBALDconsult22-Feb-20 9:35 
GeneralDesign woes Pin
honey the codewitch22-Feb-20 1:27
mvahoney the codewitch22-Feb-20 1:27 
EDIT: I decided to ship it as is

I messed up, I think.

I had my GLR parser generator all ready to go, so I want it to demo something that only an advanced parser like a GLR parser could parse (at least without handwritten parts, unlike Parsley)

I loaded up my C# subset (Slang) expression grammar and started to port it from parsley to glory which means removing the handwritten components and replacing them with the sort of BNF/XBNF constructs that Parsley couldn't parse.

Here's the problem: GLR grammars are never rejected. No matter how dodgy the grammar you give it is, it will find a way to accept it and parse it, even if what it returned might not be what you intended (as happens with complicated things)

That might not seem like a problem until you're trying to actually build a valid grammar. GLR will accept anything "valid" or not. All "invalid" means to GLR is that your parse trees won't come back in the form you expected them to.

Detecting whether a grammar is globally ambiguous is mathematically impossible (it has been proven undecidable)

So the next best thing would be to do analysis on it by trying to generate a less powerful parser using something like LL(k/*) but that doesn't quite work since LL only works on grammars that are not left recursive. Even if I knew how to implement LL(k/*) (I don't). Even if that wasn't an issue it still doesn't work because there's still a set of grammars GLR parses that LL can't - ambiguous grammars

It's a logic problem. I want it to reject invalid grammars but it can't know what "invalid" means unless I tell it, which is what the grammar is for in the first place!

The only thing i can think of is having a way to specify in the grammar that a certain construct should or should *not* be ambiguous but I am almost positive that will not work as I don't think it's mathematically possible to detect all local ambiguities either.

Frankly, GLR is *too* expressive. I just don't know what I can do about that, but it makes constructing accurate grammars extremely difficult.

Other people have built GLR parsers, so there might be a clever solution somewhere for this, but I'm not likely to google the problem and find much - GLR is rare, aside from Bison, the only "mainstream" parser offering that includes it, and it was only added later on.

If I had thought far enough ahead I would have researched that up front, but now I'm wondering if I should ship like this, or hold off until I can find a better way. Frown | :(
Real programmers use butterflies


modified 22-Feb-20 10:27am.

GeneralRe: Design woes Pin
OriginalGriff22-Feb-20 1:38
mveOriginalGriff22-Feb-20 1:38 
GeneralRe: Design woes Pin
honey the codewitch22-Feb-20 2:13
mvahoney the codewitch22-Feb-20 2:13 
NewsRe: Design woes Pin
lopatir22-Feb-20 2:45
Memberlopatir22-Feb-20 2:45 
GeneralRe: Design woes Pin
Mark_Wallace22-Feb-20 6:07
MemberMark_Wallace22-Feb-20 6:07 
GeneralRe: Design woes Pin
Member 1298255822-Feb-20 7:04
MemberMember 1298255822-Feb-20 7:04 
GeneralRe: Design woes Pin
honey the codewitch22-Feb-20 9:24
mvahoney the codewitch22-Feb-20 9:24 
GeneralRe: Design woes Pin
Gerry Schmitz22-Feb-20 7:37
mveGerry Schmitz22-Feb-20 7:37 
GeneralLatest update to Visual Studio 2019 crashing a lot Pin
Chris Maunder21-Feb-20 14:42
cofounderChris Maunder21-Feb-20 14:42 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
lopatir21-Feb-20 16:12
Memberlopatir21-Feb-20 16:12 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
Chris Maunder22-Feb-20 5:06
cofounderChris Maunder22-Feb-20 5:06 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
Arthur V. Ratz21-Feb-20 18:56
mvaArthur V. Ratz21-Feb-20 18:56 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
Chris Maunder22-Feb-20 5:03
cofounderChris Maunder22-Feb-20 5:03 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
Arthur V. Ratz22-Feb-20 6:00
mvaArthur V. Ratz22-Feb-20 6:00 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
Mark_Wallace21-Feb-20 21:41
MemberMark_Wallace21-Feb-20 21:41 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
OriginalGriff21-Feb-20 22:11
mveOriginalGriff21-Feb-20 22:11 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
Mark_Wallace21-Feb-20 22:46
MemberMark_Wallace21-Feb-20 22:46 
GeneralRe: Latest update to Visual Studio 2019 crashing a lot Pin
lopatir21-Feb-20 22:57
Memberlopatir21-Feb-20 22:57 

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.