Skip to main content
1 vote
1 answer
53 views

I see 1 shift/reduce conflict for following bison grammar: %token EQUAL "=" NUM "NUM" WORD "WORD" ; %% %start line; VALUES: NUM |...
Дмитрий Глущенко's user avatar
2 votes
1 answer
102 views

I'm using this answer as my template to add the prefix "eval": https://stackoverflow.com/a/48879103/14956120 The only difference from that answer, is that I'm on windows (using msys2), and ...
Carl HR's user avatar
  • 1,049
1 vote
0 answers
65 views

I'm trying to remove shift reduce errors in a grammar which just recognizes if-else constructs, using the %nonassoc and %prec. I know there are other ways to solve this, but I'm just trying for my own ...
Yoogi Kovendhan's user avatar
1 vote
1 answer
59 views

I am working on building a compiler using Flex/Bison, and tried to utilize a tokens.h file to define the tokens used by the parser and lexer. #ifndef TOKENS_H #define TOKENS_H enum TokenType { ...
Herr_Kobius's user avatar
-2 votes
1 answer
110 views

I tried to adapt the (only/most voted) answer of this StackOverflow question to the setting where I don't have std::string semantic values, but rather variants. This means I changed the following: In ...
Jakob E.'s user avatar
  • 334
0 votes
0 answers
80 views

How can I resolve the "undefined reference to 'yylval'" error in the simplest program ever? This is my lexer.l file %{ #include "parser.tab.h" %} %% [0-9]+ { ...
Enis Licina's user avatar
1 vote
1 answer
70 views

We are doing a calculator compiler, however, we haven't been able to run it because of file dependencies that we cannot understand. The beginning of the yacc file is as so: %{ #include "symtab.h&...
Petar Grigorov's user avatar
0 votes
0 answers
31 views

I am curious about how bison's string literal tokens are stored. Consider these definitions in myparser.y: %token FOR %token TO "->" If I understand the way the system works, the first ...
Maury Markowitz's user avatar
0 votes
0 answers
53 views

I am writing a c-like language, but for grammar shown below: module: module declORFunc | declORFunc ; declORFunc: decl | func decl: CONST_opt btype varDef_list SEMICOLON ; CONST_opt: /* ...
Peter's user avatar
  • 1
2 votes
1 answer
88 views

I'm into a project where I need to build a whole compiler for C- language. I was looking for materials on this topic but I don't found anything. I have this code's piece of a grammar rule about ...
mafesm's user avatar
  • 23
1 vote
1 answer
72 views

I'm working on a Bison grammar for arithmetic expressions, and I encountered an interesting behavior when parsing expressions with the MINUS operator. Here’s a simplified version of my grammar: %left ...
Stellaream's user avatar
1 vote
0 answers
55 views

I'm working on a parser using Go and yacc (package golang.org/x/tools/cmd/goyacc). The language I'm parsing uses the = symbol for both assignment and comparison in logical expressions. For example: ...
Artem's user avatar
  • 113
0 votes
1 answer
67 views

Test Ouputs: ./parse -r /[123456]/ Accepted! ./parse -r /[1234567]/ zsh: segmentation fault (core dumped) ./parse -r This is my flex rule for the token. \[^?([^\\\]]|\\.)*\] {yylval.value = strdup(...
Karidus's user avatar
  • 31
0 votes
1 answer
83 views

I want to make a compilator for a language similar to C. Declarations go first, then functions. Declarations can only be "int" while functions can return "int" or "void". ...
mr Klaus's user avatar
-1 votes
1 answer
90 views

I am working with flex/bison to create an interpreter for a class. The problem that I am encountering seems to be related to using/converting a dynamic vector. I am trying to create a function to ...
Justin Smith's user avatar

15 30 50 per page
1
2 3 4 5
177