[antlr-interest] grammar checking/compilation fails on Windows butnot on Linux

Sam Harwell sharwell at pixelminegames.com
Wed Mar 25 09:42:37 PDT 2009


Change your postfixExpression to this:

 

postfixExpression

        : leftHandSideExpression (('++'|'--') => ( '++' | '--' )?)

        ;

 

Sam

 

From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Filipe David Manana
Sent: Wednesday, March 25, 2009 9:51 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] grammar checking/compilation fails on Windows butnot on Linux

 

Hello,

I am facing here something weird.


I have a grammar which compiles fine under Linux (Ubuntu 64 bits, 4GB ram) and passes the grammar checking performed by AntlrWorks. (not even a single warning)

On a Windows XP machine (32bits, 3GB ram) both the compilation and checking fail.

The grammar file is accessible from http://code.google.com/p/jsdet/source/browse/trunk/src/grammars/JavaScript.g

Can somebody tell me if passes on his/her AntlrWorks checking feature?

thanks

The error messages from ANTLR are:

compile-grammar:
  [mkdir] Created dir: d:\jsdet\src\jsdet\parsing\antlr
  [java] warning(209): src/grammars/JavaScript.g:127:1: Multiple token rules can match input such as "'>'": T__80, T__81, T__96, T__98, T__101, T__102
  [java]
  [java] As a result, token(s) T__81,T__96,T__98,T__101,T__102 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1228:1: Multiple token rules can match input such as "'.'": T__115, NumericLiteral
  [java]
  [java] As a result, token(s) NumericLiteral were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1685:1: Multiple token rules can match input such as "'/'": T__75, T__106, RegexpLiteral, MultilineComment, LineComment
  [java]
  [java] As a result, token(s) T__106,RegexpLiteral,MultilineComment,LineComment were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'s'": T__70, Identifier
  [java]
  [java] As a result, token(s) Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'t'": TRUE, THIS, T__54, T__56, T__110, Identifier
  [java]
  [java] As a result, token(s) THIS,T__54,T__56,T__110,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'c'": T__57, T__66, T__71, Identifier
  [java]
  [java] As a result, token(s) T__66,T__71,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:128:1: Multiple token rules can match input such as "'+'": POSTFIX_INC, T__77, T__103
  [java]
  [java] As a result, token(s) T__77,T__103 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1689:1: Multiple token rules can match input such as "'v'": T__64, T__109, Identifier, WhiteSpace
  [java]
  [java] As a result, token(s) T__109,Identifier,WhiteSpace were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'r'": T__68, Identifier
  [java]
  [java] As a result, token(s) Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:125:1: Multiple token rules can match input such as "'<'": T__79, T__95, T__97, T__100
  [java]
  [java] As a result, token(s) T__95,T__97,T__100 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:118:1: Multiple token rules can match input such as "'='": T__73, T__91, T__93
  [java]
  [java] As a result, token(s) T__91,T__93 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:130:1: Multiple token rules can match input such as "'*'": T__74, T__105
  [java]
  [java] As a result, token(s) T__105 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'e'": T__60, Identifier
  [java]
  [java] As a result, token(s) Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'n'": NULL, T__113, Identifier
  [java]
  [java] As a result, token(s) T__113,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'f'": FALSE, T__49, T__58, T__63, Identifier
  [java]
  [java] As a result, token(s) T__49,T__58,T__63,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'i'": T__59, T__65, T__99, Identifier
  [java]
  [java] As a result, token(s) T__65,T__99,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:132:1: Multiple token rules can match input such as "'%'": T__76, T__107
  [java]
  [java] As a result, token(s) T__107 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:129:1: Multiple token rules can match input such as "'-'": POSTFIX_DEC, T__78, T__104
  [java]
  [java] As a result, token(s) T__78,T__104 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:113:1: Multiple token rules can match input such as "'|'": T__84, T__86, T__88
  [java]
  [java] As a result, token(s) T__86,T__88 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'b'": T__67, Identifier
  [java]
  [java] As a result, token(s) Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'d'": T__61, T__72, T__108, Identifier
  [java]
  [java] As a result, token(s) T__72,T__108,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:137:1: Multiple token rules can match input such as "'!'": T__92, T__94, T__112
  [java]
  [java] As a result, token(s) T__94,T__112 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:115:1: Multiple token rules can match input such as "'&'": T__82, T__87, T__90
  [java]
  [java] As a result, token(s) T__87,T__90 were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:1307:1: Multiple token rules can match input such as "'w'": T__62, T__69, Identifier
  [java]
  [java] As a result, token(s) T__69,Identifier were disabled for that input
  [java] warning(209): src/grammars/JavaScript.g:114:1: Multiple token rules can match input such as "'^'": T__83, T__89
  [java]
  [java] As a result, token(s) T__89 were disabled for that input
  [java] error(208): src/grammars/JavaScript.g:1685:1: The following token definitions can never be matched because prior tokens match the same input: THIS,T__49,T__54,T__56,T__58,T__63,T__65,T__66
,T__69,T__71,T__72,T__77,T__78,T__81,T__86,T__87,T__88,T__89,T__90,T__91,T__93,T__94,T__95,T__96,T__97,T__98,T__99,T__100,T__101,T__102,T__103,T__104,T__105,T__106,T__107,T__108,T__109,T__110,T__112,T
__113,RegexpLiteral,MultilineComment,LineComment


-- 
Filipe David Manana,
fdmanana at ieee.org
PGP key - http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC569452B

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090325/6a5d883b/attachment.html 


More information about the antlr-interest mailing list