I'm mid-process in converting Tapestry from Maven to Antlr.

My first stumbling point is Antlr; Tapestry users Antlr for its
property expression language.


There's something odd in my Maven pom.xml:

 <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr3-maven-plugin</artifactId>
        <version>3.1.1.2</version>
        <executions>
          <execution>
            <goals>
              <goal>antlr</goal>
            </goals>
            <configuration>
              <!-- This is a hack so that the parser grammar can
locate the tokens file generated by
                the lexer grammar. -->
              
<libDirectory>target/generated-sources/antlr/org/apache/tapestry5/internal/antlr
                            </libDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

My build.gradle is much simpler:



description="Central module for Tapestry, containing all core services
and components"

apply plugin: 'antlr'

dependencies {
  compile    project(':tapestry-ioc')
  compile    project(':tapestry-json')

  testCompile   project(':tapestry-test')

  compile       "commons-codec:commons-codec:1.3"
  compile       "javax.servlet:servlet-api:2.4"

  antlr         'org.antlr:antlr:3.3'

}

However, my build fails pretty quickly:

$ gr clean compileJ
:tapestry-core:clean
:tapestry-annotations:compileJava UP-TO-DATE
:tapestry-annotations:compileGroovy UP-TO-DATE
:tapestry-annotations:processResources UP-TO-DATE
:tapestry-annotations:classes UP-TO-DATE
:tapestry-annotations:jar UP-TO-DATE
:tapestry-annotations:sourcesJar UP-TO-DATE
:tapestry-core:generateGrammarSource
/Users/hlship/workspaces/tapestry/tapestry5/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g:15:1:
unexpected token: lexer
error: Token stream error reading grammar(s):
/Users/hlship/workspaces/tapestry/tapestry5/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g:20:16:
expecting ''', found 'r'
/Users/hlship/workspaces/tapestry/tapestry5/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g:15:1:
unexpected token: parser
error: Token stream error reading grammar(s):
/Users/hlship/workspaces/tapestry/tapestry5/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g:20:16:
expecting ''', found 'r'
:tapestry-func:compileJava UP-TO-DATE
:tapestry-func:compileGroovy UP-TO-DATE
:tapestry-func:processResources UP-TO-DATE
:tapestry-func:classes UP-TO-DATE
:tapestry-func:jar UP-TO-DATE
:tapestry-func:sourcesJar UP-TO-DATE
:tapestry-ioc:compileJava UP-TO-DATE
:tapestry-ioc:compileGroovy UP-TO-DATE
:tapestry-ioc:processResources UP-TO-DATE
:tapestry-ioc:classes UP-TO-DATE
:tapestry-ioc:jar UP-TO-DATE
:tapestry-ioc:sourcesJar UP-TO-DATE
:tapestry-json:compileJava UP-TO-DATE
:tapestry-json:compileGroovy UP-TO-DATE
:tapestry-json:processResources UP-TO-DATE
:tapestry-json:classes UP-TO-DATE
:tapestry-json:jar UP-TO-DATE
:tapestry-json:sourcesJar UP-TO-DATE
:tapestry-core:compileJava
/Users/hlship/workspaces/tapestry/tapestry5/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java:21:
cannot find symbol
symbol  : class PropertyExpressionLexer
location: package org.apache.tapestry5.internal.antlr
import org.apache.tapestry5.internal.antlr.PropertyExpressionLexer;

Here's the start of my lexer grammer:


lexer grammar PropertyExpressionLexer;


options
{
  superClass='org.apache.tapestry5.internal.antlr.BaseLexer';
}

@header
{
package org.apache.tapestry5.internal.antlr;
}


... which means that I need Antlr 3 to process this.  Is that my
problem?  The ANTLR Ant task documentation implies that we're limited
to Antlr 2.x.


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to