<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Sam Barnett-Cormack wrote:
<blockquote cite="mid:49ABC7D4.6020307@lancaster.ac.uk" type="cite">
  <pre wrap="">Sam Barnett-Cormack wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Sam Barnett-Cormack wrote:
    </pre>
    <br>
    <pre wrap="">
type : ((typeWithConstraint)=&gt;typeWithConstraint | builtinType | 
referencedType) constraint* ;

And a load of parser warnings and errors that it wasn't bothering to 
generate before... *sigh*
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Or even *lexer* warnings and errors

  </pre>
</blockquote>
I think that you need to start again and go a lot more slowly in
building up your grammar. There is no point asking about each and every
error you are getting, as you won't learn anything. Do this:<br>
<br>
1) Do not use 'xxxx' type things in the parser rules;<br>
2) Start with a blank lexer and parser;<br>
3) Build the parser rules for expressions, by starting with the primary
elements and gradually inserting rules in the expression tree one at a
time - compile and test after each rule, fix issue as soon as you see
them, do not leave them to accumulate as you will get nowhere;<br>
4) Now add one parser rule at a time (you will sometimes need a few at
once of course) and compile and test after each change - compile and
test after each rule, fix issue as soon as you see them, do not leave
them to accumulate as you will get nowhere;<br>
<br>
The things you are seeing are standard things that happen when you
start out by typing in a grammar from the normative grammar of some
language spec. Such language specs are not really written with writing
a parser spec in mind (most say this) and even if they are they are
usually written with yacc/bison in mind. Consequently they are full of
ambiguities that you must left factor as you go. <br>
<br>
Unless you have built a lot of grammars, that is why you need to do
this in small steps - otherwise you will end up turning on backtracking
and adorning the grammar with predicates that include entire rules such
as (typeWithConstraint)=&gt; when the real issue is that you have not
left factored the grammar correctly.<br>
<br>
Get a copy of the book if you can, it will help a lot, and read through
as much of the Wiki as you can before your fingers itch to get back at
the keyboard.<br>
<br>
Jim<br>
</body>
</html>