[antlr-interest] java : code too large for try statement => use another language?

Laura Adam ladam at vbi.vt.edu
Fri Jul 18 09:51:56 PDT 2008


Hello,

I am implementing in Anltr through Java, a program that takes a DNA sequence as input and recognizes the different parts such as promoters, linkers...

Those parts are thousands letters long.
I used rules like :

E0020 :
        ("atggtgagcaagggcgaggagctgttcaccggggtggtgcccatcctggtcgagctggacggcgacgtgaacggccacaagttcagcgtgtccggcgagggcgagggcgatgccacctacggcaagctgaccctgaagttcatctgcaccaccggcaagctgcccgtgccctggcccaccctcgtgaccaccctgacctggggcgtgcagtgcttcagccgctaccccgaccacatgaagcagcacgacttcttcaagtccgccatgcccgaaggctacgtccaggagcgcaccatcttcttcaaggacgacggcaactacaagacccgcgccgaggtgaagttcgagggcgacaccctggtgaaccgcatcgagctgaagggcatcgacttcaaggaggacggcaacatcctggggcacaagctggagtacaactacatcagccacaacgtctatatcaccgccgacaagcagaagaacggcatcaaggccaacttcaagatccgccacaacatcgaggacggcagcgtgcagctcgccgaccactaccagcagaacacccccatcggcgacggccccgtgctgctgcccgacaaccactacctgagcacccagtccgccctgagcaaagaccccaacgagaagcgcgatcacatggtcctgctggagttcgtgaccgccgccgggatcactctcggcatggacgagctgtacaagtaataa");

E0022 :
        ("atggtgagcaagggcgaggagctgttcaccggggtggtgcccatcctggtcgagctggacggcgacgtgaacggccacaagttcagcgtgtccggcgagggcgagggcgatgccacctacggcaagctgaccctgaagttcatctgcaccaccggcaagctgcccgtgccctggcccaccctcgtgaccaccctgacctggggcgtgcagtgcttcagccgctaccccgaccacatgaagcagcacgacttcttcaagtccgccatgcccgaaggctacgtccaggagcgcaccatcttcttcaaggacgacggcaactacaagacccgcgccgaggtgaagttcgagggcgacaccctggtgaaccgcatcgagctgaagggcatcgacttcaaggaggacggcaacatcctggggcacaagctggagtacaactacatcagccacaacgtctatatcaccgccgacaagcagaagaacggcatcaaggccaacttcaagatccgccacaacatcgaggacggcagcgtgcagctcgccgaccactaccagcagaacacccccatcggcgacggccccgtgctgctgcccgacaaccactacctgagcacccagtccgccctgagcaaagaccccaacgagaagcgcgatcacatggtcctgctggagttcgtgaccgccgccgggatcactctcggcatggacgagctgtacaagaggcctgctgcaaacgacgaaaactacgctttagtagcttaataa");

>If I want a 1000 lookahead characters the file.g is ok. I have no lexical nondeterminism. But when I want to use the file.g with my test_lexer.java I have that error from java: "code too large for try statement".
>If I put a 200 lookahead characters I have lexical nondeterminism but I can compile and run the java program (I don't get the result I want of course).

--> What can I do?
I think I could add intermediates in my rules but it would be long (I thought to make packs of 4 or 5 letters), non general, and not friendly to user. I don't really like that solution.
Maybe I should turn to another language such as C. Will I have the same problem? 

(That possible I misunderstood how Antlr works and how to use it. I've never worked on parsers before.)

Laura Adam



More information about the antlr-interest mailing list