Hoisting is a very difficult problem. Until I finish my new spec for
implementing reliable hoisting, I suggest one of the following:
High speed solution A, used as appropriate:
elementsTrue
: objectSetElements
| LPAREN! elementSetSpecTrue RPAREN!
;
elementsFalse
: subtypeElements
Sam Barnett-Cormack wrote:
I guess the question really is, for me, why does it get hoisted in one
case and not another? I'm assuming it's because of the choice in the
objectSetSpec rule, and I can't see any way to refactor that to lose the
choice. Of course, there's probably a kludgy
This will fail unexpectedly with certain types of grammars, as
demonstrated by some grammars I've sent to the list in the past. I'll
find them later today and send a link.
Sam
-Original Message-
From: Sam Barnett-Cormack [mailto:s.barnett-corm...@lancaster.ac.uk]
Sent: Monday, April
Sam Harwell wrote:
This will fail unexpectedly with certain types of grammars, as
demonstrated by some grammars I've sent to the list in the past. I'll
find them later today and send a link.
I can't see why it'd fail horribly in this case... the problem would
come if os were being used in a
Sam Barnett-Cormack wrote:
Sam Harwell wrote:
This will fail unexpectedly with certain types of grammars, as
demonstrated by some grammars I've sent to the list in the past. I'll
find them later today and send a link.
I can't see why it'd fail horribly in this case... the problem would
Hi,
I'm trying to get the C# target to work, only with partial success. I'm
using VS 2008 SP1 or VS 2005 with AntlrWorks and the runtime from
DOT-NET-runtime-3.1.2.zip.
The problem is, that exceptions raised due to invalid input don't
bubble up to my code. I noticed the paragraph
Johannes Luber wrote:
Hi,
I'm trying to get the C# target to work, only with partial success. I'm
using VS 2008 SP1 or VS 2005 with AntlrWorks and the runtime from
DOT-NET-runtime-3.1.2.zip.
The problem is, that exceptions raised due to invalid input don't
bubble up to my code. I noticed
Johannes Luber wrote:
Does putting a breakpoint into the catch block work? Otherwise the menu
for exceptions offers the options to break when an exception is thrown and
if an exception is caught. Furthermore, did you add a messagebox call or
console print to check if the catch block is
Sam Barnett-Cormack wrote:
Hi all,
So, in my grammar I have need to re-use rules so they ultimately refer
to a different rule (so I don't have to duplicate
intersection/union/exception rules). I use a parameter and gated
predicates, like so:
elements[boolean os]
:
Johannes Luber wrote:
Johannes Luber wrote:
Does putting a breakpoint into the catch block work? Otherwise the menu
for exceptions offers the options to break when an exception is thrown and
if an exception is caught. Furthermore, did you add a messagebox call or
console print to check if
The error handling mechanisms are fairly complicated, but adding your
own handlers is easy.
Just call the base versions after you do what you want:
public override void ReportError( RecognitionException e )
{
// do something, the StackTrace for e will tell you where the error
occurred
Jan Newger wrote:
Johannes Luber wrote:
Johannes Luber wrote:
Does putting a breakpoint into the catch block work? Otherwise the menu
for exceptions offers the options to break when an exception is thrown and
if an exception is
Sam Harwell wrote:
It's a good idea to override ReportError, and this will almost surely
provide you with the results you want. You can also put a breakpoint in
NoViableAltException's constructor.
So you are proposing that I override ReportError and re-throw the
exception? I basically want
I make my IntelliSense parser stop after N exceptions (default 20) via
an OperationCanceledException to prevent major performance problems with
very large files in the IDE, since the file is often syntactically
incorrect while it is being edited and it's reparsed often.
Sam
From:
What I do to handle SQL embedded inside C, C++, and COBOL is have
a simple preprocessor that replaces all embedded code with a single,
unique token (e.g. SQLTOKEN123) and stores the embedded code in
a hashtable (e.g. SQLTOKEN123 - EXEC SQL SELECT * FROM EMPLOYEE END-EXEC).
The lexing and parsing
Sam Barnett-Cormack wrote:
Jim Idle wrote:
Sam Barnett-Cormack wrote:
Hi all,
So, in my grammar I have need to re-use rules so they ultimately refer
to a different rule (so I don't have to duplicate
intersection/union/exception rules). I use a parameter and gated
predicates, like so:
Jim Idle wrote:
However, as you can obviously distinguish the cases at some point higher
up the rule chain, then if you wish to pursue this, then all you need do
is create a scope with your flag in it at a high enough level, init it
to the default case, then set/unset it as the rules
Sam Barnett-Cormack wrote:
Jim Idle wrote:
However, as you can obviously distinguish the cases at some point
higher up the rule chain, then if you wish to pursue this, then all
you need do is create a scope with your flag in it at a high enough
level, init it to the default case, then
Jan Newger wrote:
Sam Harwell wrote:
It's a good idea to override ReportError, and this will almost surely
provide you with the results you want. You can also put a breakpoint in
NoViableAltException's constructor.
So you are proposing that I override ReportError and re-throw the
Jim Idle wrote:
Sam Barnett-Cormack wrote:
Jim Idle wrote:
However, as you can obviously distinguish the cases at some point
higher up the rule chain, then if you wish to pursue this, then all
you need do is create a scope with your flag in it at a high enough
level, init it to the
On Apr 7, 2009, at 3:18 PM, YINGAnnie wrote:
Hi all,
Everytime when I run the program, I got this error. Here is the
grammar of packageDeclaration
packageDeclaration
@init {
tokens = (ASTokenRewriteStream)input;
Token start = input.LT(1);
}
: PACKAGE type? '{'
I had the same problem two months ago, And the best solution that I could
find was to override the ReportError method like
public override void ReportError(RecognitionException e)
{
throw e;
}
rethrowing the exception to the method that called the parser. Then there, I
could
22 matches
Mail list logo