Windows Internationalization

2008-07-09 Thread Luca
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

Re: two yyparse() functions in the same program

2008-08-03 Thread Luca
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

Re: bison 2.4

2008-11-07 Thread Luca
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

Re: $2 not a string

2008-12-07 Thread Luca
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); } |

Re: %union errors

2008-12-08 Thread Luca
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

Re: reduce/reduce error confusing declaration with subscription

2008-12-27 Thread Luca
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

Re: reduce/reduce error confusing declaration with subscription

2008-12-28 Thread Luca
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

Re: Two-pass parser or AST with Bison?

2009-01-06 Thread Luca
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

Re: Misunderstanding %prec?

2009-01-25 Thread Luca
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

Re: Without standard input

2009-05-01 Thread Luca
//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

Re: %union with STL

2009-05-24 Thread Luca
.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

Re: %union with STL

2009-05-25 Thread Luca
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

Re: %union with STL

2009-05-26 Thread Luca
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

Re: how to work with Bison locations?

2009-06-02 Thread Luca
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

Re: Unable to compile in Visual C++

2009-06-23 Thread Luca
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

Re: Looking for gnuwin32 Bison 2.3 (setup) version

2009-07-06 Thread Luca
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

Re: How to raise an error

2009-10-09 Thread Luca
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

Re: yy_scan_string

2009-10-14 Thread Luca
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 ___

Re: Question about using Bison

2009-12-08 Thread 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

Re: Name clash with token type BEGIN

2009-12-31 Thread Luca
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

Re: Graphical output for bison's debug information

2010-01-12 Thread Luca
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

Re: yyerror() location tracking

2010-01-17 Thread Luca
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

Re: Problem in grammar

2011-02-20 Thread Luca
= ... } | signal OPERATOR2 float_value{ $$ = ... } | float_value OPERATOR2 signal{ $$ = ... } ; full_function_call : ... ; Do you have any information that could help me ? Best regards, Julien ___ help

Re: bison - MSYS - Windows/DOS

2011-04-13 Thread Luca
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

Re: bison - MSYS - Windows/DOS

2011-04-14 Thread Luca
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

Re: Problems with an unrecognised Token

2011-04-23 Thread Luca
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 ___

Re: javascript_grammar_ecmascript_transform_unicode_problem

2011-08-25 Thread 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

Re: Parse Tree using Bison

2012-01-14 Thread Luca
/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

Re: Cant compile parser produced by bison using visual studio 2008

2012-02-26 Thread Luca
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

Re: Unable to remove memory leak when the parser find an error before it is fully reduced to the main production-rule.

2012-06-13 Thread Luca
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-

Re: fixed size stack

2012-07-18 Thread Luca
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

Re: Exception safety of generated C++ parser

2012-09-19 Thread Luca
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

Re: Ask for help about bison internationalization

2015-08-18 Thread Luca
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

Windows Internationalization

2008-07-09 Thread Luca Marzolla
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

Re: Windows Internationalization

2008-10-15 Thread Luca Marzolla
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

Re: How to make yyerror() report line?

2009-10-15 Thread Luca Marzolla
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

Re: How can I understand the output of bison's debug output ??

2009-10-15 Thread Luca Marzolla
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