Archive: <http://lists.gnu.org/pipermail/help-bison>
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
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
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
__
#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
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
>
>
>
>
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
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
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
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
. 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
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
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
f all the different parses without merging them.
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
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
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
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
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
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
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
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
__
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
_
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
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
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
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
& 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
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
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
___
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
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
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
/help-flex
http://lex.sourceforge.net/
--
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
be to avoid
having to do hand code special cleanup.
--
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
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 :
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
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
mailto:[EMAIL PROTECTED]
--
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
[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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
it is not currently suitable
for entering code.
--
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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.
--
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
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
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
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
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
__
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
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>
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
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
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@
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
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
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
useful for more advanced things.
--
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
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
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
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
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
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
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
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
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
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
+ 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
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
__
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
o get them.
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
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
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.
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
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
| 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
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
eep
the cc to Help-Bison, so others know.]
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
you
should make a bug report to Bug-Bison.
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
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
produce another (which might be some binary code).
Hans Aberg
___
Help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison
1 - 100 of 658 matches
Mail list logo