Re: Help with systemverilog grammar

2005-02-19 Thread Hans Aberg
Archive: <http://lists.gnu.org/pipermail/help-bison> Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Forcing multiple parse stacks to 'reduce'

2005-02-28 Thread Hans Aberg
t the parser in a thread. Activate it. When an action where you want the parser to halt is executed, as a part of the action, halt the parser thread. Then do the other stuff you want to do. When parsing needs to be resumed, reactivate the parser thread. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Forcing multiple parse stacks to 'reduce'

2005-03-01 Thread Hans Aberg
n input grammar, one creates an new "augmented" grammar with an endmarker. Provides push-down automaton is created from that. One is thus parsing a sentence with a given endmarker, which must be provided by the lexer. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Forcing multiple parse stacks to 'reduce'

2005-03-01 Thread Hans Aberg
ly late, in the 90'ies) a grammar transformation to make C becoming LALR(1) (modulo the usual context tweaks for "typedef", etc.) Then you would not need using the %glr option. You might check the newsgroup comp.compilers and its FAQ, published there monthly. Hans Aberg __

Re: Identifying rule responsible for lookahead

2005-03-01 Thread Hans Aberg
#x27;]' >7 expr: hier_id . [YYDOT (9), ']' (5)] > >YYDOT reduce using rule 4 (opt_select) >YYDOT [reduce using rule 7 (expr)] > >I was wondering if there is a way to get this >information out of bison. The problem is how

Re: Identifying rule responsible for lookahead

2005-03-02 Thread Hans Aberg
ny suggestion? (I may think a >> bit more on the >> question.) >> >> It is otherwise not a help-bison issue, but a >> "featuritis" issue, which >> normally should be posted in the bug-bison list. >> >> Hans Aberg > > > >

Re: Forcing multiple parse stacks to 'reduce'

2005-03-02 Thread Hans Aberg
time the designed those C++ features. But my memory could be wrong. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: x + (y) + z

2005-03-04 Thread Hans Aberg
onality does >not appear to be any help here. Effectively, it will only >select between two productions that consume the same >number of input tokens. The commands %left and %right handles left and right associativity. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: x + (y) + z

2005-03-06 Thread Hans Aberg
et a correct GLR parse, and can try to sort out the ambiguity later. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: x + (y) + z

2005-03-06 Thread Hans Aberg
t these names equal to the same token, and let the GLR parser handle it. It then produces all correct parses, including the possible type-name/number-name choices. You then get the correct parse trees, and need only decide how to select one over the other. Clearly, this choice

Re: x + (y) + z

2005-03-06 Thread Hans Aberg
. If you check the Haskell site, or list, you might find one for you. The problem is though that these are very slow, with stress on very: In once replaced one with a Flex-Bison combination (on the Mini-Prolog that comes with Hugs), and a very slow program became lightning fast. But with your pro

Re: x + (y) + z

2005-03-07 Thread Hans Aberg
resolve to a single parse). You can try using %merge, and then in the merge action function build in the split-parse info. (For example, registering the different parses.) Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: x + (y) + z

2005-03-07 Thread Hans Aberg
oth parses using a merge-function then. (See the Bison manual, sec 1.5.2.) Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: x + (y) + z

2005-03-07 Thread Hans Aberg
f all the different parses without merging them. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: ERROR: version file does not exist or are not readable

2005-03-09 Thread Hans Aberg
You must provide more info about when and how the error occurs (version, installation, etc.): I can't find that error string in Bison 2.0 nor in the M4 that Bison uses. If you use an older Bison version, try to update, as older versions are not supported. And bugs should be reported to the Bug-Biso

Re: Question about "Conditions for Using Bison" in Bison 2.0 documentation

2005-03-09 Thread Hans Aberg
This is most likely an error: The other skeleton files did not exist at the time that stuff was written. Akim Demaille is resposnible for the C++ file and Paul Hilfinger for the GLR file. They probably forgot to insert the correct copyright. If so, this is a Bug-Bison issue. At 14:28 +0100 2005/03

Re: Question about "Conditions for Using Bison" in Bison 2.0 documentation

2005-03-10 Thread Hans Aberg
It would simplify if the supported Bison skeleton files were distributed under the same copyright. The unsupported skeleton files, if any, should be put in a special place, either in the distribution, or outside it, I think. At 12:50 -0800 2005/03/09, Paul Hilfinger wrote: >In fact, this issue did

Re: Question about "Conditions for Using Bison" in Bison 2.0 documentation

2005-03-10 Thread Hans Aberg
ram is rarely viewed as being covered by the copyright of the program that made it. Take, for example, the text-files produced by a copyrighted program. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: ERROR: version file does not exist or are not readable

2005-03-10 Thread Hans Aberg
at the computer use some other program that also is called bison. So, when I change the path everything works correctly. > >-Ursprungligt meddelande- >Från: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Hans >Aberg >Skickat: onsdagen den 9 mars 2005 19:24 >Till: Ol

Re: Question about "Conditions for Using Bison" in Bison 2.0 documentation

2005-03-10 Thread Hans Aberg
Isn't there only about one case where the GPL has been tried in court? At 14:04 -0800 2005/03/10, Paul Hilfinger wrote: > > Hans Aberg <[EMAIL PROTECTED]> writes: > > > > > the output of a copyrighted program is rarely viewed as being > > > covere

Re: Question about "Conditions for Using Bison" in Bison 2.0 documentation

2005-03-11 Thread Hans Aberg
that it is wrong for Yacc/Bison to put a single copyright on the output file. But also, second, it is a tricky question what copyrighted material one can use for free. I believe that news reporting can include copyrighted quotes and such, without having to oblige to the original copyright

Re: Identifying rule responsible for lookahead

2005-03-11 Thread Hans Aberg
is in >spanish. It is not right version, next week it will be available. Sometimes >the url is wrong but try it later there is the document. > >I hope it will be useful. And if you have suggest you can email me. Surely I >will put the source latex in that url. Hans Aberg __

unixodbc and yy_flush_buffer (2.0)

2005-03-19 Thread Hans Aberg
ch >unixodbc acordingly. yy_flush_buffer is a feature of Flex. So try the Help-flex mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-flex can you give me any hit to solve this issue? Did I hit you well enough? :-) -- Hans Aberg _

Re: Grammar definition problem.

2005-03-21 Thread Hans Aberg
In addition, note that most wold put this stuff in the lexer (generated say by Flex). At 14:55 +0530 2005/03/21, Atul Kulkarni wrote: Hi All, I am facing problem in defining the following grammar for Bison. X -> letter { letter | digit }. here letter and digit are terminals and X is the non term

Re: %union errors that shouldn't be there

2005-03-21 Thread Hans Aberg
d I don't have time to test this myself at the moment. They should be OK in C++, as pointers do not have non-trival con-/de-structors. The compiler needs to see a declaration of the name as a type, though, before it sees the pointer. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: %union errors that shouldn't be there

2005-03-21 Thread Hans Aberg
st don't see what I am doing wrong. Your help is appreciated. ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

RE: %union errors that shouldn't be there

2005-03-21 Thread Hans Aberg
rst in the list which caused it not to see the definitions of my classes and even the std::string even though I included using namespace std;. Thank You. Dmitry. -Original Message----- From: Hans Aberg [mailto:[EMAIL PROTECTED] Sent: Monday, March 21, 2005 1:17 PM To: [EMAIL PROTECTED] Cc: help-bis

Re: Grammar definition problem.

2005-03-22 Thread Hans Aberg
& Ullman, "Compilers..." (the "Dragon Book"). At 10:12 +0530 2005/03/22, Atul Kulkarni wrote: hi, Read your reply on the Bison mailing list, but failed to under stand your point. Can you please explain? Regards, Atul. On Mon, 21 Mar 2005 19:18:28 +0100, Hans Aberg <[E

Re: %union errors that shouldn't be there

2005-03-22 Thread Hans Aberg
At 10:39 +0100 2005/03/22, Laurence Finston wrote: On Mon, 21 Mar 2005, Hans Aberg wrote: They should be OK in C++, as pointers do not have non-trival con-/de-structors. The compiler needs to see a declaration of the name as a type, though, before it sees the pointer. If I remember correctly

Re: %union errors that shouldn't be there

2005-03-23 Thread Hans Aberg
pes with constructors and destructors in a `%union' in Bison, but not with an unextended C or C++ union. This is just my opinion, but I think it's simpler to just use `void*'. So you have a suggestion of an extended union above. -- Hans Aberg ___

Re: %union errors that shouldn't be there

2005-03-23 Thread Hans Aberg
At 19:34 +0100 2005/03/23, Laurence Finston wrote: On Wed, 23 Mar 2005, Hans Aberg wrote: At 14:16 +0100 2005/03/23, Laurence Finston wrote: >Add it where? Just add a field, invisible to the user, with the type information. I meant "in C++ or in Bison?" In the context, I tho

Re: %union errors that shouldn't be there

2005-03-24 Thread Hans Aberg
as one cannot only mix the two languages using 'extern "C"' linkage from C++ for functions only. Perhaps there is a problem if the function has a C union as an argument. But then it does not have any non-trivial constructors to keep track of. So perhaps it

Re: %union errors that shouldn't be there

2005-03-24 Thread Hans Aberg
vel programming with C++ that's possible with C. If this were so, it would make C++ useless from my point of view. (I know not everybody will agree me.) C++ has been developed over several decades. And some of the later C++ features have problems to coex

Re: Flex Problem, I did not find a list for Flex hence postin here.

2005-03-24 Thread Hans Aberg
/help-flex http://lex.sourceforge.net/ -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: %union errors that shouldn't be there

2005-03-26 Thread Hans Aberg
at it will be perfectly simple to use it as `YYSTYPE' (I haven't tried it yet). So what problem are you trying to solve? Unions are faster than dynamic allocations, and in the past, it was important that they take little space. One example where I have used it

Re: %union errors that shouldn't be there

2005-03-27 Thread Hans Aberg
be to avoid having to do hand code special cleanup. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: A simple example of using bison++ and flex++

2005-03-28 Thread Hans Aberg
that bison++ resp. flex++ are programs separate from bison and flex? These lists have nothing to do with those program. If you supply an example using Bison and Flex, that would be of interest on these lists. -- Hans Aberg ___ Help-bison@gnu.org

Re: Help with shift/reduce conflict

2005-03-29 Thread Hans Aberg
As Henrik Sorensen points out, you need to be more specific about the grammar you want to produce. Here is a suggestion though: %token YYID %% expression: hier_id | method_call | paren_expr ; paren_expr: '(' expression ')' ; method_call: paren_expr '.' YYID paren_expr ; hier_id :

Re: flex++/bison++

2005-03-31 Thread Hans Aberg
about flex++/bison++ ? The programs bison++ and flex++ are supposedly unrelated to Bison and Flex. Latest Bison 2.0 and also Flex already has some C++ support, though it might be made more convenient. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gn

Re: What about Flex/Bison tutorial's for newbies?

2005-03-31 Thread Hans Aberg
there monthly.) Then read use the before mentioned manuals and hang out in the before mentioned newsgroup. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re[2]: What about Flex/Bison tutorial's for newbies?

2005-04-01 Thread Hans Aberg
mailto:[EMAIL PROTECTED] -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Simple Flex/Bison example

2005-04-01 Thread Hans Aberg
Here is a simple calculator, using Flex and Bison. -- Hans Aberg calcex.tgz Description: Binary data ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: bison installation help!!!

2005-04-01 Thread Hans Aberg
[Sorry for the delay in reply: Your email got spam classified, and was sorted away on my computer.] Have you tried to read the file INSTALL that comes with the bison distribution? At 11:24 +0900 2004/10/18, mj Kang wrote: p {margin-top:0px;margin-bottom:0px;} dear I'm interested in bison and I

Re: Bison version for PHP5.x installation on HPUX 11.11

2005-04-07 Thread Hans Aberg
net/>, and look into its makefile to see what it expects. Or the information should be there, somewhere, on that site, or some mailing list there, etc. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Conflicts shift/reduction

2005-04-13 Thread Hans Aberg
e sure the grammar is OK, you might try the %glr option. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: viewing parse tree

2005-04-14 Thread Hans Aberg
tools. In Bison, one uses normally the hands on approach, adding the stuff by hand the rule actions. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Problem with a simple grammar

2005-04-17 Thread Hans Aberg
your lexer. Thus you only get a pointer into a buffer, as you work with pointers. PS. I have to use bison 1.24 so you may not be able to help me. This is rather old; the latest release is 2.0 -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org

Re: Problem with a simple grammar

2005-04-17 Thread Hans Aberg
ant. But if you are starting afresh, that might not be a problem to you. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Problem with a simple grammar

2005-04-17 Thread Hans Aberg
at is executed if you do a "make check". (I am using Bison 2.0 with a special tweak for my own C++ skeleton file, so that can't be used straight off.) -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: error decoding before a numeric constant

2005-04-18 Thread Hans Aberg
x27;t found any information about this error. Can anyone help us with the error or give us info about it? Are you using only Bison? Are you sure the error does not come from say GCC? -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: error decoding before a numeric constant

2005-04-20 Thread Hans Aberg
Have you checked po/, the files es.gmo es.po? It should be possible to natural language localize, though I do not know how. Those files, though, do not contain the indicated error message. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/ma

Re: New BISON version for VMS

2005-04-20 Thread Hans Aberg
only supports POSIX, and all else are extra. If you are willing, or find someone willing, to make a VMS install, you might get help at the Bug-Bison list. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Bison and embedded systems

2005-04-25 Thread Hans Aberg
Eggert, who wrote the dynamic memory feature; perhaps he can help. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Bison and embedded systems

2005-04-26 Thread Hans Aberg
al parser stack size at a suitable value. I am not sure why alloca isn't usable in embedded systems; perhaps it is not available. And, if the parser stack is fixed, how is overflow handled. And if it is set too a high value, isn't that a poor use of

Re: %destructor and stack overflow

2005-04-26 Thread Hans Aberg
Again, this is probably a question for Paul to answer, who wrote the current C-parser. I thought that the C-parser was dynamic, except when free store runs out, in which case one is toast anyway. What version of Bison are you using? Is it Bison 2.0? If you have disabled parser stack dynamic rea

Re: %destructor and stack overflow

2005-04-26 Thread Hans Aberg
At 00:09 +0200 2005/04/27, Marcus Holland-Moritz wrote: On 2005-04-26, at 23:46:10 +0200, Hans Aberg wrote: Again, this is probably a question for Paul to answer, who wrote the current C-parser. I thought that the C-parser was dynamic, except when free store runs out, in which case one is toast

Re: %destructor and stack overflow

2005-04-27 Thread Hans Aberg
ot;real" memory when passed illegal input. So if you get a stack overflow error, what do you want to happen? Clearly, the parser must be taken down. You want it then to done so that stack cleanup takes place. Right? Possibly, the same cleanup actions as those in %de

Re: %destructor and stack overflow

2005-04-28 Thread Hans Aberg
e, I must ask Paul or Akim (who wrote the %destructor feature) help me out. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: warning: rule never reduced because of conflicts: @3: /* empty */

2005-05-01 Thread Hans Aberg
arser input can cause those rules to be reduced. Normally that is an error in the grammar design. If you enter a mid-rule action, Bison will implement that by introducing an anonymous, empty rule, which thus is prone at generating conflicts, if not used cautiously. -- Hans

Re: Extra code in x.tab.h

2005-05-01 Thread Hans Aberg
it is not currently suitable for entering code. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: warning: rule never reduced because of conflicts: @3: /* empty */

2005-05-01 Thread Hans Aberg
ously. -- Hans Aberg Thanks for your answer Hans ! I was doing something really stupid, I just hadn't noticed :-). Finally I got i working, it was a matter of noting where the problem was, as always happen with silly problems/errors, you see. Cheers, Edulix. --

Re: Bison Question: Ambiguous Grammar?

2005-05-06 Thread Hans Aberg
ed to define its construction in the actions. When people ask that question, they often need much less; if you so want, you may precise your programming situation. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Bison Question: Ambiguous Grammar?

2005-05-06 Thread Hans Aberg
Thus, there is a difference between GLR based on LALR(1) or on LR(1). The advantage of this approach, though, over a genuinely non-deterministic parsing, is that the latter is very slow. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailma

Re: Passing filled AST to yyparse() caller after successful parse

2005-05-08 Thread Hans Aberg
inger, who wrote it, to see if he can let us know. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: reentrant parser - how?

2005-05-08 Thread Hans Aberg
At 23:26 +0200 2005/05/04, Carsten Krueger wrote: can anybody tell me how this lexer-parser-combination would look if it is a reentrant parser? I recall Paul Eggert said that the Bison generated parser, which he wrote, now is fully pure. If you have some data to be passed to the parser, that shou

Re: reentrant parser - how?

2005-05-08 Thread Hans Aberg
manual, or ask in the Help-Flex list. I use something like "lexer_.initialize(isp_)", but I do not know if that is the original Flex lexer function. The parser function yyparse() will be reset every time it is called anew. It only parses tokens, not streams. -- Hans Aberg __

Re: Passing filled AST to yyparse() caller after successful parse

2005-05-08 Thread Hans Aberg
At 12:11 -0400 2005/05/08, Jeannot Langlois wrote: I am not sure the %glr parser currently works in pure mode. Let's cc Paul Hilfinger, who wrote it, to see if he can let us know. -- Hans Aberg Hi Hans (and Hi all), Just a few minutes after I posted the question to the mailing list, I found

Re: please help on infix yylex.

2005-05-09 Thread Hans Aberg
following rules and it never worked:( I tried to fix this for long time but I am not able to see where I am making a mistake? Please help. I posted 2005/04/01 an example "Simple Flex/Bison example" in this list. See: List-Archive: <http://lists.gnu.org/pipermail/help-bison>

Re: Question regarding Bison and Hypermail

2005-05-10 Thread Hans Aberg
If anyone has any suggestions, please reply. This is for a project and I am running out of time. I am installing all this on Solaris 9. I think this question has been up here before, and it is a problem in the getdate package, some another GNU software. Contact those who wrote

Re: About flex source, please help

2005-05-11 Thread Hans Aberg
ask in the newsgroup comp.compilers, and checking its FAQ, published there monthly. Also, the latest Flex versions, including CVS, are available at: http://lex.sourceforge.net/ -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/li

Re: Fwd: Q: processing multiple mixed data streams using bison

2005-05-29 Thread Hans Aberg
version Bison 2005/05/23, see List-Archive: <http://lists.gnu.org/pipermail/help-bison> Question about making Flex generating a pure lexer should be directed to: List-Post: <mailto:help-flex@gnu.org> -- Hans Aberg ___ Help-bison@

Re: Fwd: Q: processing multiple mixed data streams using bison

2005-05-29 Thread Hans Aberg
pport this and I won't have to introduce custom code to save/restore its context? Mohit. On 5/29/05, Hans Aberg <[EMAIL PROTECTED]> wrote: At 23:53 -0700 2005/05/28, Mohit Jaggi wrote: >Hi All, >I am trying to process multiple interleaved streams of data in a >single proces

Re: bison 2.0 for windows

2005-06-08 Thread Hans Aberg
DOS buils is probably broken right now. Is anybody compiling for windows? thanks in advance Alex ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison -- Hans Aberg ___ Help-bis

Output generation

2005-06-08 Thread Hans Aberg
eton files, as well as other uses. Guile could though be used to simplify the implementation of new parser algorithms as well. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: calculator with additional function

2005-06-10 Thread Hans Aberg
useful for more advanced things. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Re: calculator with additional function

2005-06-11 Thread Hans Aberg
other language. Just a few days ago, there has come to my attention the tool <http://www.codeworker.org>, probably useful for more advanced things. -- Hans Aberg -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Flex/Bison: which version to use?

2005-06-13 Thread Hans Aberg
ntages? When should I need to think about whether I should use the "++" programs? Those are independent programs, supposedly old. Bison and Flex do not have anything with them to do, what I know. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: "Eating" comments: not with Flex but with Bison

2005-06-13 Thread Hans Aberg
checking a global variable doing this. This variable can be turned on/off from the parser. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Interpreting shift/reduce conflicts from .output file

2005-06-15 Thread Hans Aberg
orm, it will not work. So then you may decide to rewrite your grammar. -- Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: "nested" languages

2005-06-28 Thread Hans Aberg
els, one could write it in directly in a static grammar, though. There, some do it, others use the first method. In general, no method is better than the other; in the specific case, one chooses the one most convenient, simply. You might also get more inputs on this question in the newsgroup c

Re: %union, C++, symbol types

2005-07-07 Thread Hans Aberg
ed, not requiring a union for implementation, and %code which admits proper code placement). But it cannot handle it right now. Also try out latest Bison alpha <ftp://alpha.gnu.org/gnu/bison/ bison-2.0a.tar.gz>; it should be more reliable than the version

Re: Flex: token value more than what regexp matches

2005-07-08 Thread Hans Aberg
er, temporarily '0'- terminated, and in order to preserve that in subsequent lexer calls, you need to copy it over. The Bison parser does indeed make several calls to the lexer before the rule action is invoked. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: %union, C++, symbol types

2005-07-19 Thread Hans Aberg
class T_null : public T { public: clone_declare(formula_null); copy_declare(formula_null); ... }; Two points: If one wants to use static_cast, instead of dynamic_cast, then the base classes cannot be virtual in derivation. And the class T_null above is used to implement special behavior of ref(). Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Lexical feedback and lookahead

2005-07-19 Thread Hans Aberg
body top level "{" ... "}" has completed. This can be kept track of by a bracket depth count in the lexer. Any ideas? It seems to me that I need an 'unget' implementation. In Bison, it is called %glr. Hans Aberg ___ H

Re: [help-bison]How to stock information?

2005-07-19 Thread Hans Aberg
t to build suitable strings or macros. Assume you have statement: "{" statement_body "}" statement_body: /* Builds "u(n)=u(n-1)+3*u(n-2);u{0}=1;u{1}=2;" */ Then you need an action for "statement" like statement: "{" statement_body "}" { $$ = "begin Name=Suite; begin DEFINITION=RECURRENTE;" + $1 + ... } where "+" is string concatenation. I hope you see the idea. You can simplify token handling by using Flex, and let every token return the text that is lexed. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: [help-bison]How to stock information?

2005-07-20 Thread Hans Aberg
+ standards. The newsgroup comp.compilers has a FAQ, published there monthly, which you can look into. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Lexical feedback and lookahead

2005-07-20 Thread Hans Aberg
the alternative would have been to use GLR. But as it happened, I made a different grammar, where these constructs are no longer present, though the question may arise again. You may also ask in the newsgroup comp.compilers for more inputs. Hans Aberg __

Re: [help-bison]How to stock information?

2005-07-20 Thread Hans Aberg
n ;) You don't use the whole grammars of say C++, but only selected subparts, say for the type of expressions that you want. Don't try to copy the C++ informal grammar-like stuff, because you will get into trouble; just use it as an inspira

Re: Need Help in Shift Reduce Errors

2005-07-22 Thread Hans Aberg
o get them. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Need help in Bison with Unicode

2005-07-23 Thread Hans Aberg
n the flex list, posted a Haskell program, by which one can generate Flex like regular expressions from Unicode character classes. I think there might be Flex support for Unicode, but I do not know how this work progresses. Hans Aberg ___ Help

Re: can we generate a C++ parser with Bison?

2005-07-27 Thread Hans Aberg
using GLR. If you want a Yacc-like C++ grammar, see http://www.parashift.com/c++-faq-lite/compiler- dependencies.html#faq-38.11 More general info about compiler construction can be found in he Usenet newsgroup comp.compilers and the FAQ published there monthly. Hans Aberg

Re: $1 is not $1 but $1+$2

2005-07-30 Thread Hans Aberg
ords, in the passage from one rule to another, the value of dbname is lost. Any advice? Check the FAQ: http://www.gnu.org/software/bison/manual/html_mono/ bison.html#Strings-are-Destroyed Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.

Re: Which one is "better" ?

2005-07-31 Thread Hans Aberg
t in a lookup array, so the number does not affect parser size. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Re[2]: Which one is "better" ?

2005-07-31 Thread Hans Aberg
ler..." (the "dragon book"). You might look into the book by Dick Grune, available online (see the FAQ of the newsgroup comp.compilers, published there monthly). In short, the grammar isn't stored at all in the parser, only the states one

Re: Implicit Multiplication

2005-08-06 Thread Hans Aberg
| expression expression %prec '*' /* this rule causes problems */ ; By your last rule, for example a + b c + d becomes ambiguous, as it admits the interpretations (a + b) (c + d) and a + (b c) + d. Grammatically, implicit multiplication only applies to certain situa

Re: Implicit Multiplication

2005-08-06 Thread Hans Aberg
sion '|' expression | expression '^' expression | IDENTIFIER IDENTIFIER | IDENTIFIER '(' expression ')' | '(' expression ')' IDENTIFIER | '(' expression ')' '(' expression ')' ; Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Implicit Multiplication

2005-08-09 Thread Hans Aberg
eep the cc to Help-Bison, so others know.] Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: classical error but unresolved "syntax error at end of input"

2005-08-10 Thread Hans Aberg
you should make a bug report to Bug-Bison. Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: problem with $$, maybe bug??

2005-08-10 Thread Hans Aberg
unDesigParams($$), the pointer has changed its value but i can assure you that i do not touch that $$ any other place but here, and still do not change it at that Macro(fundesigparams) In the $$ value of the first action is named $2 in the last action. Is th

Re: question

2005-08-14 Thread Hans Aberg
produce another (which might be some binary code). Hans Aberg ___ Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

  1   2   3   4   5   6   7   >