yacc Questions

1

Solved

Iam trying to develop a program for a calculator using lex and yacc. I keeping getting the following error: calc.y: warning: 5 nonterminals useless in grammar [-Wother] calc.y: warning: 8 rules u...
Ingeminate asked 9/1, 2017 at 7:53

1

Solved

I have a following production in a bison spec: op : '+' { printf("%d %d %c\n", $1, '+', '+'); } When I input a + I get the following output: 0 43 + Can someone explain why $1 has a value of 0...
Appointed asked 1/6, 2016 at 20:34

2

How does one make a comment in Lex and Yacc? So far I haven't tried Yacc, but in Lex I have tried /* comment */ and // comment, but neither of these compile. I am on a Mac, using the builtin Lex a...
Galbraith asked 17/5, 2016 at 2:52

3

Solved

I want to pass the actual string of a token. If I have a token called ID, then I want my yacc file to actually know what ID is called. I thing I have to pass a string using yylval to the yacc file ...
Heteromerous asked 5/12, 2009 at 10:35

2

Solved

I am trying to run the first part of a simple example of the PLY but I encounter a strange error. When I run the following code, it gives me an error regarding lex.lex() Anyone knows what the prob...
Withoutdoors asked 22/2, 2016 at 22:52

3

Solved

I am trying to include a struct as part of the union with Bison, but I get an error on the 'struct node args' in %union: parser.y:17: error: field ‘args’ has incomplete type The Code: struct n...
Lazarolazaruk asked 16/9, 2009 at 1:1

2

Solved

{% #include<stdio.h> #include<stdlib.h> %} %token ID NUM IF THEN LE GE EQ NE OR AND ELSE %right '=' %left AND OR %left '<' '>' LE GE EQ NE %left '+''-' %left '*''/' %right UMIN...
Refulgent asked 13/10, 2012 at 20:7

1

Solved

So this is kind of a trivial question, but it's bugging me that I can't answer it, and perhaps the answer will teach me some more details about how R works. The title says it all: how does R parse...
Pena asked 4/1, 2016 at 20:11

3

I think Bison and Yacc are very often used for parsing grammars of programming languages. (and lex/flex for tokenizing...) My Question is: Are all compilers made with this tools or are ther...
Arachnoid asked 27/12, 2015 at 0:13

1

Solved

What is the meaning of yytext[0]? And why should we use in the lex and yacc program? I'm learner so don't mind if it is a silly question.
Intercommunicate asked 21/11, 2015 at 11:33

2

Solved

notype_declarator: notype_declarator '(' parmlist_or_identifiers %prec '.' { $$ = build_nt (CALL_EXPR, $1, $3, NULL_TREE); } Anyone familiar with yacc rules?
Crag asked 16/3, 2011 at 19:15

2

Hello there: Do you folks know of any GNU/Linux utility to format a Bison grammar file, containing C code, nicely? I'm thinking of something along the lines of GNU Indent, but designed to bea...
Septuor asked 13/6, 2010 at 11:11

1

Solved

I have flex code that copies a string lexeme using strdup(). %{ #include "json.tab.h" #define YY_DECL extern "C" int yylex() %} %option noyywrap %% [ \t\n]+ ; \"[a-zA-Z]+\" {yylval.sval = st...
Vacuity asked 28/6, 2015 at 20:14

1

Solved

I'm trying to use YACC with xcode, which is natively supported, and for that effect I found this sample which is working nicely. My idea is to build my own grammar, so I started experimenting with ...
Alabama asked 19/5, 2015 at 13:49

7

Solved

I'm looking for the C grammar in GCC source code, more specifically for the grammar in the yacc/bison form.
Spumescent asked 27/4, 2010 at 12:24

1

Solved

I am trying to run an example I found online of a calculator. But I have this error showing every time I run my gcc command. Here are the commands that I run: flex -l calc3.l yacc -vd calc3.y gcc ...
Fecal asked 29/1, 2015 at 10:10

2

My objective is to parse like Python does with strings. Question: How to write a lex to support the following: "string..." 'string...' """multi line string \n \n end""" '''multi line string \n \...
Pudens asked 12/12, 2013 at 12:8

2

I have a question for yacc compiler. I do not compile simple yacc grammar. Here is the code section : /*anbn_0.y */ %token A B %% start: anbn '\n' {printf(" is in anbn_0\n"); return 0;} anbn: emp...
Vociferance asked 20/11, 2013 at 20:41

1

Solved

I'm trying to generate a compiler so I can pass him a .c file after. I've downloaded both YACC and LEX grammars from http://www.quut.com/c/ANSI-C-grammar-y.html and named them clexyacc.l and clexy...
Ornamentation asked 17/5, 2014 at 23:17

2

Solved

All, Developing a validating application for embedded sql i'll use ansi c or c++ as developement language Where do i get an sql grammar for lex and yacc?
Carlinecarling asked 28/12, 2011 at 14:7

5

Solved

Is there a good yacc/bison type LALR parser generator for .NET ?
Failure asked 31/8, 2008 at 9:28

1

Solved

I have a yacc file describing a certain language for which i am developing an Editor using IMP (eclipse project).I am using LPG as a parser generator, so I needed to extract a BNF rules from my yac...
Remainder asked 20/10, 2013 at 12:2

3

Solved

I'm currently trying to write a small compiler using Flex+Bison but I'm kinda of lost in terms of what to do with error handlling, specially how to make everything fit together. To motivate the dis...
Passifloraceous asked 16/9, 2013 at 21:44

5

Solved

I'm writing a grammar in YACC (actually Bison), and I'm having a shift/reduce problem. It results from including the postfix increment and decrement operators. Here is a trimmed down version of the...
Leban asked 20/5, 2009 at 20:24

2

I've never done Bison or Wisent before. how can I get started? My real goal is to produce a working Wisent/Semantic grammar for C#, to allow C# to be edited in emacs with code-completion, and all...
Arieariel asked 4/6, 2010 at 20:34

© 2022 - 2024 — McMap. All rights reserved.