Click here to Skip to main content
14,299,969 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.
 
Generaljust got in touch with the guy i learned to code with Pin
honey the codewitch2-Aug-19 5:47
memberhoney the codewitch2-Aug-19 5:47 
GeneralRe: just got in touch with the guy i learned to code with Pin
OriginalGriff2-Aug-19 6:04
protectorOriginalGriff2-Aug-19 6:04 
GeneralRe: just got in touch with the guy i learned to code with Pin
CodeWraith2-Aug-19 6:24
memberCodeWraith2-Aug-19 6:24 
GeneralRe: just got in touch with the guy i learned to code with Pin
honey the codewitch2-Aug-19 6:24
memberhoney the codewitch2-Aug-19 6:24 
GeneralRe: just got in touch with the guy i learned to code with Pin
CodeWraith2-Aug-19 6:33
memberCodeWraith2-Aug-19 6:33 
GeneralRe: just got in touch with the guy i learned to code with Pin
PIEBALDconsult2-Aug-19 6:33
protectorPIEBALDconsult2-Aug-19 6:33 
GeneralRe: just got in touch with the guy i learned to code with Pin
Jon McKee2-Aug-19 11:41
professionalJon McKee2-Aug-19 11:41 
Questionis this too much console? Pin
honey the codewitch2-Aug-19 5:17
memberhoney the codewitch2-Aug-19 5:17 
I've broken up the different parser / lexer generator tasks into console accessible operations

so - if you want to take an XBNF document

like this

grammar<start>= productions;

productions<collapsed> = production productions | production;
production= identifier [ "<" attributes ">" ] "=" expressions ";";

expressions<collapsed>= expression { "|" expression }; 
expression= { symbol };
symbol= literal | regex | identifier | 
	"(" expressions ")" | 
	"[" expressions "]" |
	"{" expressions ("}"|"}+");
...


and turn into a pck spec (which you have to do before you can do much else with it)

grammar:start
productions:collapsed
expressions:collapsed
symbollist:collapsed
attributelisttail:collapsed
grammar-> productions
productions-> production productions
productions-> production
production-> identifier lt attributes gt eq expressions semi
production-> identifier eq expressions semi
expressions-> expression expressionlisttail
expressions-> expression
expression-> symbollist
expression->
symbol-> literal
symbol-> regex
symbol-> identifier
symbol-> lparen expressions rparen
symbol-> lbracket expressions rbracket
symbol-> lbrace expressions rbrace
symbol-> lbrace expressions rbracePlus
...


you'd use the command line like
pckw xlt xbnf.xbnf xbnf.pck


now, before you can use it with an LL(1) parser (including mine, or say Coco/R) you have to "factor" it

from the command line
pckw ll1 xbnf.pck xbnf.ll1.pck


you can then generate the code for it or export it whatever
pckw fagen xbnf.ll1.pck XbnfTokenizer.cs

pckw ll1gen xbnf.ll1.pck XbnfParser.cs


or you can pipe these operations. Like, turn an xbnf grammar into a parser:

pckw xlt xbnf.xbnf /transform xbnfToPck | pckw ll1 | pckw ll1gen /class XbnfParser > XbnfParser.cs



My question is, is this too much BS?
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.

AnswerRe: is this too much console? Pin
Ravi Bhavnani2-Aug-19 5:21
professionalRavi Bhavnani2-Aug-19 5:21 
GeneralRe: is this too much console? Pin
honey the codewitch2-Aug-19 5:25
memberhoney the codewitch2-Aug-19 5:25 
AnswerRe: is this too much console? Pin
PIEBALDconsult2-Aug-19 9:43
protectorPIEBALDconsult2-Aug-19 9:43 
GeneralRe: is this too much console? Pin
honey the codewitch2-Aug-19 9:44
memberhoney the codewitch2-Aug-19 9:44 
AnswerRe: is this too much console? Pin
j snooze2-Aug-19 11:48
memberj snooze2-Aug-19 11:48 
GeneralRe: is this too much console? Pin
honey the codewitch2-Aug-19 11:49
memberhoney the codewitch2-Aug-19 11:49 
AnswerRe: is this too much console? Pin
Mark_Wallace2-Aug-19 19:41
memberMark_Wallace2-Aug-19 19:41 
GeneralRe: is this too much console? Pin
honey the codewitch2-Aug-19 19:44
memberhoney the codewitch2-Aug-19 19:44 
AnswerRe: is this too much console? Pin
BillWoodruff3-Aug-19 1:49
mveBillWoodruff3-Aug-19 1:49 
AnswerRe: is this too much console? Pin
Marc Clifton3-Aug-19 12:00
protectorMarc Clifton3-Aug-19 12:00 
GeneralRe: is this too much console? Pin
honey the codewitch3-Aug-19 12:01
memberhoney the codewitch3-Aug-19 12:01 
GeneralThought of the Day Pin
OriginalGriff2-Aug-19 4:44
protectorOriginalGriff2-Aug-19 4:44 
GeneralRe: Thought of the Day Pin
glennPattonWork2-Aug-19 4:46
professionalglennPattonWork2-Aug-19 4:46 
GeneralRe: Thought of the Day Pin
W Balboos2-Aug-19 5:23
mveW Balboos2-Aug-19 5:23 
QuestionRe: Thought of the Day Pin
lopatir2-Aug-19 5:31
memberlopatir2-Aug-19 5:31 
GeneralRe: Thought of the Day Pin
PIEBALDconsult2-Aug-19 5:36
protectorPIEBALDconsult2-Aug-19 5:36 
GeneralRe: Thought of the Day Pin
Jacquers2-Aug-19 20:51
memberJacquers2-Aug-19 20:51 

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.