Hello!
I have written a compiler for a pascal-like language, using flex and bison.
The compiler is built under Windows using Visual Studio and works very
well, however how can I provide an internationalization?
I need to translate syntax error messages generated by bison's parser in
another lan
george smith ha scritto:
Hello,
I am building a compiler where i need a parser for the front end and another
one for the back end. So i will need two parsers in the same program
but there will be a conflict between the function names as with the global
variables. Is there any way to change the na
You can install cygwin and try to download directly bison 2.4 package,
if available.
I think only 2.3 is available at present day;
anyway I have installed cygwin with devel package and I have
successfully compiled (./configure) and installed (make and make
install) bison 2.4.
Luca
Clyde
Jim Michaels ha scritto:
in the .y file,
|
ZERO T_SECTION
{ SyntaxNode t; t.ystype=0; t.enum_ystype=STRVAL; t.datum.strval=_strdup($2); deque_put_back(t); }
|
our source code.
In this way you can also redefine YYLTYPE (user custom locations), YYLLOC_DEFAULT (to merge locations) and YY_LOCATION_PRINT (to print locations) without any trouble.
Luca
I think
there was something about constructors as well. I believe this is
documented in the section abo
declaration_specifiers init_declarator_list ';'
| declaration_specifiers '[' constant_expression ']'
init_declarator_list ';'
;
I have added the third production: "int[4] a, b;" is parsed without generate conflicts in bison or syntax errors i
Tom Lieber ha scritto:
On Sat, Dec 27, 2008 at 9:02 AM, Luca wrote:
Tom Lieber ha scritto:
I'm creating a parser for a C-like language, basing it on this ANSI C
grammar:
http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
I would like to change the syntax for declaring variabl
Matthias Kramm ha scritto:
Hi All,
I'm still busy compiling ActionScript 3.0, which, among
others, supports forward function calls:
function bar() {
foo("", 3)
}
function foo(s:String, i:int) {
}
In order to properly resolve these (and check for correct
arguments), I ca
EMICOLON
;
postfix_expression:
ID LPAREN exp RPAREN
;
exp:
ID
| MINUS exp %prec NEG
;
%%
A hint: you can use directly the token '(' rather than LPAREN in .y
file; of course lex has to return the char and not the token.
Luca
Tom Lieber ha scritto:
I either don't understan
//code
YY_BUFFER_STATE b=yy_scan_string(stringToParse);
yy_switch_to_buffer(b);
yyparse();
Luca
___
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
.tab.h
#include userdef.h
#include y.tab.h
then use biosondef.h in place of y.tab.h anywhere in your source code.
In this way you can also redefine YYLTYPE (user custom locations),
YYLLOC_DEFAULT (to merge locations) and YY_LOCATION_PRINT (to print
locations) without any trouble.
Luca
On May
Hans Aberg ha scritto:
On 24 May 2009, at 16:13, Luca wrote:
C++ dont allow unions containing c++ classes
I think you're wrong. The size of a pointer is always known at
compile time, pair* it; is a pointer and not an
object. The size is 4 bytes using a 32 bit OS.
The problem is wha
Hans Aberg ha scritto:
On 25 May 2009, at 22:11, Luca wrote:
I successfully compiled a union containing pair*
it; using bison 2.4.1.
I think you can use pointers to C++ class inside a union without any
trouble. Just try it.
Checking what the compiler accepts is a good way to produce
non
locations, for
example to add a field to the struct to track also file location),
YYLLOC_DEFAULT (to merge locations) and YY_LOCATION_PRINT (to print
locations) without any trouble.
You have to redefine those macro BEFORE to include y.tab.h otherwise
the compiler will complain.
Luca
Kyn
Joel E. Denny ha scritto:
On Fri, 19 Jun 2009, Ewa Rom wrote:
%{
int yylex();
void yyerror(char *s);
#include "stdafx.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include "parser.hpp"
#include "resource.h"
nodeType *v(char s);
nodeType *in(i
You can compile the source code using cygwin. It works well.
Luca
Labar, Dominique ha scritto:
Hi,
I would like to grab a first Bison knowledge by developing the sample
described on http://idlebox.net/2007/flex-bison-cpp-example/ .
The gnuwin32 setup version I am currently using is
ognize the error and perform the right action
(so they can propagate the error up to the root of the syntax tree).
I suggest to read the follwing pdf:
http://epaperpress.com/lexandyacc/download/lexyacc.pdf
there is an example for a calculator using node.
Bye,
Luca
BradDaBug ha scritto:
My parse
h_to_buffer(b); //buffer change
yyparse();
yylex_destroy(); //to avoid leakage
You can read how "Multiple Input Buffers" works in flex help:
http://flex.sourceforge.net/manual/Multiple-Input-Buffers.html#Multiple-Input-Buffers
Luca
___
l be slower).
I had written many parsers using bison and flex and compiling under VS,
let me know if you have some problems.
Luca
___
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
ne BEGIN macro in the definition section of lex (before
the first %%) after including y.tab.h:
http://flex.sourceforge.net/manual/Definitions-Section.html#Definitions-Section
for example
#include y.tab.h
#undef BEGIN
%%
"BEGIN"{return 268; //you cannot place BEGIN here cos the
prepr
in a smart way, just build a syntax
tree (in the actions) and then walk it. You can print out an XML node
for each syntax node; after building a XML file you can use a browser or
a grafical tool (for example yed,
http://www.yworks.com/en/products_yed_abo
macro.
If you need you can redefine YYLTYPE and YYLLOC_DEFAULT according to
your purposes.
Luca
___
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
= ... }
| signal OPERATOR2 float_value{ $$ = ... }
| float_value OPERATOR2 signal{ $$ = ... }
;
full_function_call : ...
;
Do you have any information that could help me ?
Best regards,
Julien
___
help
l C++ 2005 IDE" could be useful:
http://msdn.microsoft.com/en-us/library/aa730877%28v=vs.80%29.aspx
you can download build rules from here:
http://www.microsoft.com/downloads/en/details.aspx?FamilyId=36873774-CA5B-4B49-ACB7-94B8CD4EF502&display
Il 13/04/2011 21.22, Gus Gassmann ha scritto:
Luca tin.it> writes:
You can run bison from a batch file,
then add the batch file to a VS post build event ,
but you have to add bison to your path, e.g:
path=%path%;c:\PATH_TO_BISON_EXE\bison.exe
I don't think that is enough. T
Polish Notation
Calculator), taken from bison help:
http://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html
your lexer should be close to this one:
http://www.gnu.org/software/bison/manual/html_node/Rpcalc-Lexer.html#Rpcalc-Lexer
Bye,
Luca
___
Il 25/08/2011 3.13, Giannis St ha scritto:
hi!
I would like to create a parser for javascript(certainly a subset of
it). I tried to transform ecmascriptA3g(for antlr3) in order to use it
in bison but i had some issues with some unicode characters.
Does Bison support unicode chars?
Thi
/download/LexAndYaccTutorial.pdf
it is about yacc, but the tutorial is very good and also valid using Bison.
Luca
___
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison
Il 26/02/2012 10.27, the_transltr ha scritto:
one help
It should compile.
I used Visual studio 6, 2005, 2008 and 2010 with bison without any problem.
Please report an example.
Luca
___
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help
er),
or if the parser is always running as a background service (eg visual
studio intellisense)
Luca
On 12/06/2012 14:12, Fabricio Pellegrini wrote:
Hello,
First of all, I'm using:
- Window 7 Enterprise 32bits
- Visual Studio 2010
- Bison++ Version 1.21-
that will help to
understand how the memory is used.
Luca
On 17/07/2012 10:00, Claudio Eterno wrote:
Hi folks,
I'm writing here due to some configuration problems on bison.
My question: I would like to use bison for an embedded application (based
on a uC with only 16kb of ram a 256 kb of
on
to apply, for example:
%destructor{delete $$} exp stmt
since $$ is a
::std::string *token;
for "exp" and "stmt".
Also using "C", you can always put a void* inside the union.
Luca
___
help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison
On 08/07/2015 10:19, haifeng.qin wrote:
Hi!
1. How to generate code files that the string in files is a
wide-character(wstring/wchar_t)?
2. How to build bison on windows?
thanks!
___
help-bison@gnu.org https://lists.gnu.org/mailman/listi
Hello!
I have written a compiler for a pascal-like language, using flex and bison.
The compiler is built under Windows using Visual Studio and works very
well, however how can I provide an internationalization?
I need to translate syntax error messages generated by bison's parser in
another lan
Tim Van Holder ha scritto:
Luca wrote:
Hello!
I have written a compiler for a pascal-like language, using flex and
bison.
The compiler is built under Windows using Visual Studio and works
very well, however how can I provide an internationalization?
I need to translate syntax error messages
yylineno in Flex:
http://flex.sourceforge.net/manual/Options-Affecting-Scanner-Behavior.html#Options-Affecting-Scanner-Behavior
Luca
___
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
an't find the corresponding description at line xxx in file
"grammer.output" !!!
Help
or "grammer.ypp" file
___
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
It seems the trace of the lexer!
--acceptin
37 matches
Mail list logo