Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
109 views

Consider the following grammar: S → A A → S | a This grammar would have an accept/reduce conflict in the SLR(1) parsing table in the state with the following kernel when reading the end symbol($): ...
Missge8urt's user avatar
1 vote
1 answer
535 views

I have to construct LR(0) table to know if there are any sort of conflicts? Is there a way to look at the grammar and tell if there's a conflict without constructing the table? So yeah, the question ...
Pavel Averin's user avatar
1 vote
1 answer
49 views

I am working on defining a bison grammar for http and am dealing with a number of shift/reduce conflicts with regards to how optional whitespace is handled at the end of the header field value. Here ...
Josh Meise's user avatar
1 vote
0 answers
54 views

Can the following ABNF rules be written as a bison LALR grammar without any conflicts (shift/reduce or reduce/reduce)? Among them, lowercase letters are non-terminal symbols, and uppercase letters are ...
neorobin's user avatar
  • 139
0 votes
1 answer
180 views

I'm writing an extended mathematical expression evaluator. It is supposed to allow defining macros in the form: f(x):=2*x I'm using Irony to break the expression into the parse tree. Grammar looks ...
Spook's user avatar
  • 26.2k
0 votes
0 answers
53 views

Ive been working on a project and have come across: Below is the list of if declarations, I have everything here except for the types in typeSpec, but we don't have to worry about those for right now....
FroyoJones's user avatar
2 votes
1 answer
944 views

I'm attempting to write my own programming language at the moment, and I have the following simplified grammar: ... %% prog: stmtlist | %empty; block: "{" stmtlist "}"; ...
jinscoe123's user avatar
  • 1,759
0 votes
1 answer
250 views

I'm trying to implement a grammar that allows multiplication by juxtaposition. This is for parsing polynomial inputs for a CAS. It works quite well, except few edge cases, as far as I'm aware of. ...
Jay Lee's user avatar
  • 1,981
0 votes
2 answers
426 views

expression -> expression OPER expression expression -> PREFIX expression expression -> expression POSTFIX expression -> expression ‘?’ expression ‘:’ expression expression -> expression ...
Anastasia Kar's user avatar
0 votes
1 answer
52 views

This is the grammar: expr-> expr OPER expr expr->PREFIX expr expr->expr POSTFIX expr->expr ‘?’ expr ‘:’ expr expr->expr‘[’ expr ‘]’ expr->expr‘(’ expr ‘)’ expr->ID expr->...
Computer Eng's user avatar
0 votes
1 answer
539 views

Firstly, I have already referred to many similar questions here, but unable to resolve the conflicts. I have this piece in my .y file . . . obj : INT { $$ = objNew($1, INT_T); } | FLOAT { $$ = ...
Sourav Kannantha B's user avatar
1 vote
0 answers
101 views

I'm trying to create a parser for a simple language, but I can't get rid of some reduce/reduce conflicts because of the rules expr: l_value and r_value: '@' l_value. I tried to fix it determining a ...
Kat's user avatar
  • 11
1 vote
1 answer
323 views

I wanted to make a reader which reads configuration files similar to INI files for mswin. It is for exercise to teach myself using a lexer/parser generator which I made. The grammar is: %lexer ...
Felix.leg's user avatar
  • 843
2 votes
1 answer
1k views

I am writing a compiler for the B programming language. The grammar of this language distinguishes lvalues and rvalues syntactically. While translating the grammar into yacc syntax, I stumbled upon ...
fuz's user avatar
  • 94.8k
0 votes
1 answer
128 views

I am using Bison (AFAIK they use LL(1) parsing as default). My grammar says something like this: function_decl: ID '(' params ')' ':' TYPE ... // body may go here function_call: ID '(' arguments ')' ...
Chitholian's user avatar
1 vote
0 answers
381 views

I am using Redux for my web application. State has to be updated after user login. Redux logger is used for debugging. Everything is fine in redux logger but state is not updated. Please give any idea ...
Venkat's user avatar
  • 371
1 vote
1 answer
261 views

OK, I have tried to rewrite this Bison grammar three times now and keep running into shift/reduce and reduce/reduce conflicts. The Syntax that I am trying to parse is as follows. The items in the {.....
JonBelanger's user avatar
7 votes
0 answers
97 views

I have a grammar that, depending on the order of productions, happy reports 3 reduce/reduce conflicts or none. The minimal example I can find is: %tokentype {Token} %token int { Int } '-' ...
sfogarty's user avatar
2 votes
0 answers
113 views

While many questions are asking to help solve reduce-reduce conflicts, I don't have any of those and I am actually asking your help to find some. I am writing documentation and exercices about LR(1) ...
Olivier Melançon's user avatar
0 votes
0 answers
40 views

Problem Part of grammar: tracelevel : TRACELEVEL LPAREN IDENT RPAREN { $$ = makeFuncTraceLevel($3); } | TRACELEVEL error { $$ = 0; error("Expected 'log(<EV_TRACE>...
Pranjali's user avatar
1 vote
2 answers
696 views

I have written following grammar: %union{ string *s; float num; } %token div_token mod_token sqrt_token it_token abs_token %token <num> num_token %token <s> Stampa %type <num&...
Laika_Boss's user avatar
0 votes
1 answer
470 views

Problem part of grammar: expr_var: var_or_ID | expr_var '[' expr ']' | NEW expr_var '(' expr_listE ')' | expr_var '(' expr_listE ')' | expr_var ARROW expr_var | expr_var ARROW '{' expr_var '}' | ...
Artem Prokudin's user avatar
0 votes
1 answer
77 views

Consider the following (admittedly nonsensical - it has been vastly simplified to illustrate the point) grammar: negationExpression : TOK_MINUS constantExpression %prec UNARYOP | testRule ...
user4520's user avatar
  • 3,495
0 votes
0 answers
122 views

I tried some of the solutions I found here but it didn't work (could be that I applied them wrong though). Here is some of my grammar: Program: Marker1 PROGRAM DECLARATIONS STATEMENTS END ; ...
user3765713's user avatar
0 votes
1 answer
149 views

So I am new to Bison and I am trying to make a simple calculator. When I do the bison -d command it says there are 7 reduce/reduce conflicts and I am not really sure why is this, I know it's because ...
walt disney's user avatar
0 votes
1 answer
104 views

I'm building a grammar in bison and I have a r/r conflict (which I know where it is), but I don't know how to fix it. I would appreciate any possible help. The part of my code that includes the ...
Nten0's user avatar
  • 65
0 votes
1 answer
129 views

I'm implementing a javascript interpreter and I'm having trouble with a bison reduce/reduce conflict in the grammar for function declarations and function expressions. I'm not all that experienced ...
Malbrain's user avatar
4 votes
2 answers
8k views

We have a CFG grammar and we construct LR(1) Parsing Table. We see that one cell on the parsing table have a reduce - reduce conflict. Is it possible to solve this conflict by using more input symbols ...
Iakob Fokas's user avatar
1 vote
1 answer
218 views

I am writing a grammar (YACC - "LALR") that should recognize the following words, for example: ident(ident,...,ident) = ident(num,ident,num,...,num) ident(ident,...,ident) = num ident = num ident = ...
Samfaitmal's user avatar
0 votes
1 answer
425 views

I have been trying to figure out this same issue for almost 2 weeks now. At first it was shift-reduce errors now its reduce-reduce problems. I have tried doing it so many ways and now I have came to ...
Anth0ny229's user avatar
0 votes
0 answers
378 views

I have been trying to figure out how to fix some shift reduce conflicts I have. I have looked around and found different topics on fixing it but it seems like no matter what I do I just can't seem to ...
Anth0ny229's user avatar
1 vote
2 answers
136 views

I am sending some data in the Mapper and when I try to read them in the Reducer, they have changed a little. In resume, I fill the data using the set functions and then I read them in the reducer ...
MagicTaly's user avatar
0 votes
1 answer
169 views

i want to create a parser for a dynamically typed language. in my bison file i have a rule for runtimetyped which is a variable name or a function call. runtimetyped : T_ID { $$ = create_identifier($...
linluk's user avatar
  • 1,670
1 vote
1 answer
2k views

I have the following error when I try to pass an IntWritable from my mapper to my reducer: INFO mapreduce.Job: Task Id : attempt_1413976354988_0009_r_000000_1, Status : FAILED Error: java.lang....
Guillermo Maris's user avatar
0 votes
1 answer
140 views

my code is the following: %% %token blablabla %% expresion: operand operand '-' expresion |operand '+' expresion | '(' expresion ')' /*Conflict line*/ ; /*...
qwerty's user avatar
  • 546
0 votes
3 answers
360 views

I am writing a bison+flex parser for a certain query language and I need to add a C-style cast operator to it. Here is the relevant part of the code: %token <characterToken> Identifier %token &...
apchhee's user avatar
0 votes
1 answer
253 views

Im get a conflict reduce-reduce in the below code , ive tried almost all i ideas i came up with to solving it heres the report of the problem, this is a BNF->Gold parser conversion any ideas to solve ...
Noize's user avatar
  • 187
0 votes
1 answer
559 views

I have a parser project for my compilers class. I could not resolve a reduce/reduce conflict for one of the rules. The graphical representation of this grammar rule is available at this link (sorry I ...
user3416142's user avatar
1 vote
2 answers
534 views

I've created a compiler for a language which has the following grammer, as defined by ML-Yacc (Starting symbol is "program" which is defined at the bottom): %nonassoc FUN VAR ASSIGN PLUSASSIGN ...
Mathias Vorreiter Pedersen's user avatar
0 votes
0 answers
205 views

I am trying to write a parser for a simple language that recognizes integer and float expressions using ocamlyacc. However I want to introduce the possiblity of having variables. So i defined the ...
Vivek Pradhan's user avatar
1 vote
1 answer
766 views

I'm working on a small compiler in order to get a greater appreciation of the difficulties of creating one's own language. Right now I'm at the stage of adding pointer functionality to my grammar but ...
Tarrasch's user avatar
  • 10.6k
0 votes
2 answers
190 views

I am getting a reduce/reduce conflict for the following grammar in bison because n is also an epsilon production. m : {$$=line_no;} ; n : { ...
Aakash Anuj's user avatar
  • 3,869
0 votes
1 answer
72 views

is there a way to controll the reduction operation of a token with ANTLR at runtime. For example, I've an ANTLR grammar that looks like: s: ( a | b); a: WORD; b: WORD; WORD: ('a'..'z')+ Where the ...
bachr's user avatar
  • 6,056
3 votes
1 answer
428 views

The following simple grammar to parse a logical expression results in a reduce/reduce conflict: %token AND OR %token NUMBER VARIABLE %% logical_expr : logical_expr AND logical_term | ...
jlam's user avatar
  • 33
0 votes
1 answer
968 views

i have to translate this EBNF to bison: <compound-statement> ::= begin [ <statement> ( ; <statement> )*] end <statement> ::= | <assignment> | <if-statement> | &...
underhiscanvas's user avatar
1 vote
2 answers
612 views

Here is an excerpt from [filename].output state 94 32 expr: expr . opt_at_type '.' TYPEID '(' opt_expr_list ')' 39 | expr . '+' expr 40 | expr . '-' expr 41 | expr . '*' ...
Alexander Suraphel's user avatar
3 votes
1 answer
1k views

Why this raises a warning about reduce/reduce conflict root : set1 'X' | set2 'X' 'X' set1 : 'A' | 'B' set2 : 'B' | 'C' but the next is ok? ...
user1374768's user avatar
1 vote
1 answer
253 views

I have the following grammar for checking the validity of an XML file, the file starts with an element and then the root node. program : terminal_node root ; root : '<' ID ...
mihajlv's user avatar
  • 2,333
1 vote
2 answers
286 views

What happen is there is a specific case where after analyzing the AST i will know if there is an error or not when the rule is finished. I tried yyerror("blah") with no luck. Because i cant tell it ...
user avatar
4 votes
1 answer
4k views

I am new to Bison parsing and I cannot understand how it works. I have the following grammar, where I have kept the bare minimum to highlight the problem. %left '~' %left '+' %token T_VARIABLE %% ...
linepogl's user avatar
  • 9,385