[antlr-interest] Flumoxed by Javascript Target

Hugo Leeney hugo.leeney at gmail.com
Thu Apr 30 09:34:14 PDT 2009


Thanks so much for that lightning reply. Unfortunately I'm probably
not serious about dev'ing a target as Boss wants the actual problem
solved asap, not the generic one.. :(

On the build side of things, is there supposed to be a pom.xml in the
antlr-3.1.3 directory? I downloaded from
http://www.antlr.org/download/antlr-3.1.3.tar.gz, BUILD.txt says I
should see one, but I don't. BUILD.txt does say something about
'possibly need to install the master pom in your local repository' and
to execute 'mvn -N install'. I tried that and got

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: resources. It requires a project with an existing p
m.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Thu Apr 30 16:49:31 BST 2009
[INFO] Final Memory: 4M/7M
[INFO] ------------------------------------------------------------------------

I cd'd into 'tool' and exec'd 'mvn -Dmaven.test.skip=true', after
downloading  *cough* several files .. it succeeded !!

So that lead me to fisheye and probably more appropriately hudson
(can't download directories in fisheye right?). In hudson I'd have to
download each 'component' separately I think so that would mean no
master build either.. ?

On Thu, Apr 30, 2009 at 4:58 PM, Jim Idle <jimi at temporal-wave.com> wrote:
> Hugo Leeney wrote:
>> Hi All,
>>
>> I had an idea that it would be good to use some of my Antlr knowledge
>> to solve a problem I'm solving in javascript. Unfortunately I haven't
>> been able to get started yet.
>>
>> I'm totally confused how I should start. This page
>> (http://www.antlr.org/wiki/display/ANTLR3/ANTLR3JavaScriptTarget) says
>> the the javascript target is integrated into the release but when I
>> try a simple grammar the simple Calculator example I get
>>
>> error(10):  internal error: group JavaScript does not satisfy interface ANTLRCor
>> e: mismatched arguments on these templates [treeParser(grammar, name, scopes, to
>> kens, tokenNames, globalAction, rules, numRules, bitsets, labelType, ASTLabelTyp
>> e, superClass, members, filterMode)]
>>
>> Looking at the google group I thought I should go about building the
>> javascript target -
>> http://code.google.com/p/antlr-javascript/wiki/BuildingANTLRJavaScriptTarget
>>
>> That page seems to be out of date though. It says -
>> "Build ANTLR itself. See the note by Hamilton at this page
>> http://www.antlr.org/wiki/pages/viewpage.action?pageId=732 "
>>
>> That page says to build ANTLR by calling 'ant' in the main directory
>> where build.xml is... ANTLR 3.1.3 uses Maven right? Theres no
>> build.xml  (outside of some of the target source directories).
>>
>> Can anyone give me friendly shove in the right direction?
>>
> I don't think that the Javascript target was ever finished to be honest.
>
> Many people find it easier to unjar the 3.1.3 jar, then set CLASSPATH to
> include the expanded directories (note you will see that there is the
> tool, runtime and so on), but I hate messing around with CLASSPATH as it
> always seems to get out of sync ;-). You can then work on your templates
> directly in that tree.
>
> If you are serious about developing a target, then the best thing to do
> is ask Terence for a perforce account, sync the source and create a new
> directory js2 or something like that. Then copy the templates from the
> Java target and add a Targetxxx.java. Go through each template and add a
> text like "TBD - template xyz", so that when the code is generated, you
> will always get an error telling you what you have not yet done. There
> are debug options and so on but doing this will force you to read every
> template before you start and you will know a lot more about what you
> are facing (and can give up then if you like ;-).
>
> When you have a p4 sync you can build the jars by following the
> instructions in BUILD.txt
>
> Jim
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list