Click here to Skip to main content
15,905,427 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: Mindfulness and coding - sometimes i forget Pin
lopatir10-May-19 4:40
lopatir10-May-19 4:40 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
honey the codewitch10-May-19 4:45
mvahoney the codewitch10-May-19 4:45 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
Gary Wheeler10-May-19 6:48
Gary Wheeler10-May-19 6:48 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
John R. Shaw10-May-19 13:18
John R. Shaw10-May-19 13:18 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
stoneyowl210-May-19 5:16
stoneyowl210-May-19 5:16 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
Daniel Pfeffer10-May-19 5:33
professionalDaniel Pfeffer10-May-19 5:33 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
Gary Wheeler10-May-19 7:09
Gary Wheeler10-May-19 7:09 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
honey the codewitch10-May-19 8:16
mvahoney the codewitch10-May-19 8:16 
I've been coding since 1986 so i feel you.

I like to find unexplored problems though. The one that inspired this post was left factoring grammars.

as here Left Factoring[^]

Never done it before. The goal is to be able to programmatically modify a target grammar like the following so it can be parsed with an LL(1) parser. It must not be left recursive, and must not have two productions with the same starting right hand and left hand side such that A = B b | B c is illegal, and so is A = A a (but A = a A is fine)

Here's the target grammar - an EBNF describing its own syntax

grammar<start>=productions;
productions= productions production | production;
production=identifier ["<" attributes ">"] "=" expressions ";";
expressions= expressions "|" expression | expression;
symbol = literal | regex | identifier | "(" expressions ")" | "[" expressions "]";
expression = symbols;
symbols= symbol symbols |;
attributes= attributes "," attribute | attribute;
attribute= identifier ["=" attrval];
attrval= literal | integer | identifier;

literal = '"([^"\\]|\\[.])*"';
regex = '\'([^\'\\]|\\[.])*\'';
identifier= '[A-Z_a-z][\-0-9A-Z_a-z]*';
integer='\-?[0-9]+';
whitespace<hidden>= '[ \v\f\t\r\n]';


In the end I did it. This can parse itself using LL(1) after I feed it through my transformation algo
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: Mindfulness and coding - sometimes i forget Pin
Dr.Walt Fair, PE10-May-19 9:55
professionalDr.Walt Fair, PE10-May-19 9:55 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
Marc Clifton10-May-19 8:31
mvaMarc Clifton10-May-19 8:31 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
honey the codewitch10-May-19 9:07
mvahoney the codewitch10-May-19 9:07 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
Jacquers11-May-19 0:12
Jacquers11-May-19 0:12 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
Dean Roddey11-May-19 8:01
Dean Roddey11-May-19 8:01 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
honey the codewitch11-May-19 8:02
mvahoney the codewitch11-May-19 8:02 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
TNCaver13-May-19 6:52
TNCaver13-May-19 6:52 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
honey the codewitch13-May-19 6:53
mvahoney the codewitch13-May-19 6:53 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
TNCaver13-May-19 8:15
TNCaver13-May-19 8:15 
GeneralRe: Mindfulness and coding - sometimes i forget Pin
honey the codewitch13-May-19 6:54
mvahoney the codewitch13-May-19 6:54 
GeneralAuthor, "Design of Everyday Things" explains problems Pin
raddevus10-May-19 2:47
mvaraddevus10-May-19 2:47 
GeneralRe: Author, "Design of Everyday Things" explains problems Pin
Rick York10-May-19 4:56
mveRick York10-May-19 4:56 
GeneralRe: Author, "Design of Everyday Things" explains problems Pin
Gary Wheeler10-May-19 6:56
Gary Wheeler10-May-19 6:56 
GeneralRe: Author, "Design of Everyday Things" explains problems Pin
raddevus10-May-19 7:13
mvaraddevus10-May-19 7:13 
GeneralRe: Author, "Design of Everyday Things" explains problems Pin
Gary Wheeler10-May-19 7:16
Gary Wheeler10-May-19 7:16 
GeneralRe: Author, "Design of Everyday Things" explains problems Pin
raddevus10-May-19 8:52
mvaraddevus10-May-19 8:52 
GeneralRe: Author, "Design of Everyday Things" explains problems Pin
Rick York10-May-19 9:13
mveRick York10-May-19 9:13 

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.