Giter Site home page Giter Site logo

ohboyohboyohboy / antlr3 Goto Github PK

View Code? Open in Web Editor NEW
76.0 76.0 12.0 23.25 MB

Fully-featured ruby parser generation using ANTLR version 3

Home Page: http://antlr.ohboyohboyohboy.org/

License: Other

Ruby 13.13% GAP 0.48% CSS 0.45% Java 0.10% Shell 0.01% Python 0.01% HTML 85.83%

antlr3's People

Contributors

dwarring avatar skalarproduktraum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

antlr3's Issues

Passing options to imports?

I've been looking into using composite grammars.

I can see in templates/Ruby.stg there is a method defined called initializeDirectDelegate which merges options with :state => @state but by default it seems to be using newDelegate which just passes :state => @state.

Is it possible to get it to use the initializeDirectDelegate method, as I want to pass some initializer options through the to the composite grammar.

Importing Grammar causes Warning

Still compiles and works, though. Messages are just misleading.

Get this warning (times the number of variables you're importing) :

  • warning(24): template error: context [/outputFile /rootGrammarOutputFile /lexer /_sub78 /delegateLexerRule] 3:94 no such property or can't access: null.attributes

Said to be "Due to a bug in releases before 3.5"

How to access the following[] tokens from state?

Hi,

Within a parser, Is it possible to know what are the available paths to follow from the current position? For example, I have the following very simple grammar:

grammar Simple;

options {
  language=Ruby;
  k='*';
  backtrack=true;
  memoize=true;
  output=AST;
}

simple
  :   
  SELECT { p @state } (ALL | FROM) 'DUAL'
  ;

SELECT: 'SELECT';
ALL: 'ALL';
FROM: 'FROM';

Then I use the following snippet:

require 'rubygems'
require 'antlr3'
require 'SimpleParser.rb'
require 'SimpleLexer.rb'

text = 'SELECT'
lexer = Simple::Lexer.new(text)
tokens = ANTLR3::CommonTokenStream.new(lexer)
parser = Simple::Parser.new(tokens)
parser.simple

Runing this I was hoping to get the following[] property of the @state with all the next possible paths to follow. Unfortunately, this property is always empty. Can you shed some light here? How this property is supposed to work?

Many thanks!

rake antlr doesn't work. it depends on missing 'isolate/installer'

"rake antlr" fails
rake antlr
(in /Users/ecerulm/ruby/antlr-ruby)
rake aborted!
no such file to load -- isolate/installer
/Users/ecerulm/ruby/antlr-ruby/rakefile:7:in `load'
(See full trace by running task with --trace)

I can't find any isolate/installer in the git repository but it found a installer.rb in the original isolate git repo

https://github.com/jbarnette/isolate/blob/3_1/lib/isolate/installer.rb

I think you forgot to add this file to version control.

Templates missing ?

when issuing antlr4ruby CPP.g it complaines of not finding ...

actionGate.st
parserBody.st
ruleBody.st

where can i find or how to generate ? ...

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.

How did I find you?

I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well

rake test:unit FATAL -- : undefined method `lines'

$ rake test:unit
(in /ruby-antlr3)
antlr-tests unit
F, [2010-02-04T10:59:44.130346 #85366] FATAL -- : undefined method lines' for #<String:0x122021c> (NoMethodError) ./dev-lib/enhanced-test/session.rb:309:incompute_weight'
./dev-lib/enhanced-test/session.rb:231:in weight' ./dev-lib/enhanced-test/session.rb:76:inrun_tests'
/Users/flux/ruby-antlr3/vendor/gems/fattr-2.1.0/lib/fattr.rb:99:in inject' ./dev-lib/enhanced-test/session.rb:75:ineach'
./dev-lib/enhanced-test/session.rb:75:in inject' ./dev-lib/enhanced-test/session.rb:75:inrun_tests'
./scripts/antlr-tests:35:in run_tests' ./scripts/antlr-tests:42:insession'
./scripts/antlr-tests:33:in run_tests' ./scripts/antlr-tests:82:inrun'
/Users/flux/ruby-antlr3/vendor/gems/main-4.2.0/lib/main/program/class_methods.rb:147:in run!' /Users/flux/ruby-antlr3/vendor/gems/main-4.2.0/lib/main/program/class_methods.rb:147:inrun'
/Users/flux/ruby-antlr3/vendor/gems/main-4.2.0/lib/main/program/class_methods.rb:136:in catch' /Users/flux/ruby-antlr3/vendor/gems/main-4.2.0/lib/main/program/class_methods.rb:136:inrun'
/Users/flux/ruby-antlr3/vendor/gems/main-4.2.0/lib/main/factories.rb:18:in run' /Users/flux/ruby-antlr3/vendor/gems/main-4.2.0/lib/main/factories.rb:25:inMain'
./scripts/antlr-tests:10

setup.rb do not work ...

neither does $ scripts/gem-bundle.rb
ERROR: While executing gem ... (TypeError)
wrong argument type Symbol (expected Proc)

please advise ...

thanks

Tree Parser documentation is empty

In the wiki and the web documentation the sections for tree parsers and ASTs are empty.
Is that functionality working in the Ruby port? Is there example code?
I'll see what I can work out from the mainline ANTLR documentation and the source in the meantime.

undefined method error

Hi there,

...and thanks for antlr4ruby!

Now, the problem I have... I've just downloaded an antlr3 grammar for PLSQL from the following address: http://www.antlr.org/pipermail/antlr-interest/attachments/20090625/ecbb1671/attachment-0003.obj

I've played a little bit with it under Java and everything was just fine. Then I decided to adapt it to be used under Ruby, which was rather a trivial task. However, some valid SQL statements which are successfully parsed with the Java generated parser, fail under the Ruby parser with the following error stack:

:!ruby1.8 -w test2.rb
/var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/recognizers.rb:257: warning: method redefined; discarding old default_rule
/var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/tree.rb:1194: warning: method redefined; discarding old extract_text
/var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/recognizers.rb:801:in send': undefined methodsynpred387_PLSQL3j' for #PLSQL3j::Parser:0xb7455f6c (NoMethodError)
from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/recognizers.rb:801:in syntactic_predicate?' from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/recognizers.rb:790:inbacktrack'
from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/recognizers.rb:801:in syntactic_predicate?' from /home/talek/rubystuff/PLSQL3jParser.rb:1512 from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/dfa.rb:244:incall'
from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/dfa.rb:244:in predict' from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/dfa.rb:241:intimes'
from /var/lib/gems/1.8/gems/antlr3-1.7.2/lib/antlr3/dfa.rb:241:in predict' from /home/talek/rubystuff/PLSQL3jParser.rb:4922:inexpr_expr'
from /home/talek/rubystuff/PLSQL3jParser.rb:4820:in expr_pow' from /home/talek/rubystuff/PLSQL3jParser.rb:4752:inexpr_sign'
from /home/talek/rubystuff/PLSQL3jParser.rb:4615:in expr_mul' from /home/talek/rubystuff/PLSQL3jParser.rb:4497:inexpr_add'
from /home/talek/rubystuff/PLSQL3jParser.rb:4429:in sql_expression' from /home/talek/rubystuff/PLSQL3jParser.rb:2959:indisplayed_column'
from /home/talek/rubystuff/PLSQL3jParser.rb:5222:in select_list' from /home/talek/rubystuff/PLSQL3jParser.rb:4696:inselect_expression'
from /home/talek/rubystuff/PLSQL3jParser.rb:4565:in select_statement' from /home/talek/rubystuff/PLSQL3jParser.rb:4500:inselect_command'
from test2.rb:8

The SQL statement which fails to parse is:
SELECT 3+3 X FROM DUAL

It is strange that the Java generated parser successfully parse this statement. According to the error stack it seems that the problem is somewhere deep into the ANTLR3 ruby library and before I digg further I thought it would be better to ask you for any hints or ideas about the above issue?

Many thanks in advance!

Does not work on Rubinius

Hi there,

first of all: Nice work man!

But it seems not to work on Rubinius ( rbx-1.0.1-20100603 ), when trying to run my test-file I get:

An exception occurred running test.rb
Missing or uninitialized constant: ANTLR3::TokenSource::StopIteration (NameError)
Backtrace:
Module#const_missing at kernel/common/module.rb:538
ANTLR3::TokenSource(ERDL::Lexer)#each at /home/nils/.rvm/gems/rbx-1.0.1-      20100603/gems/antlr3-1.8.2/lib/antlr3/token.rb:330
      Enumerable(ERDL::Lexer)#to_a at kernel/common/enumerable.rb:871
ANTLR3::CommonTokenStream#initialize at /home/nils/.rvm/gems/rbx-1.0.1-20100603/gems/antlr3-1.8.2/lib/antlr3/streams.rb:794
ANTLR3::Parser(ERDL::Parser)#cast_input at /home/nils/.rvm/gems/rbx-1.0.1-20100603/gems/antlr3-1.8.2/lib/antlr3/recognizers.rb:1322
ANTLR3::Parser(ERDL::Parser)#initialize at /home/nils/.rvm/gems/rbx-1.0.1-20100603/gems/antlr3-1.8.2/lib/antlr3/recognizers.rb:1277
           ERDL::Parser#initialize at ERDLParser.rb:110
                   main.__script__ at test.rb:22
  Rubinius::CodeLoader#load_script at kernel/delta/codeloader.rb:67
  Rubinius::CodeLoader.load_script at kernel/delta/codeloader.rb:91
           Rubinius::Loader#script at kernel/loader.rb:435
             Rubinius::Loader#main at kernel/loader.rb:527
             Rubinius::Loader.main at kernel/loader.rb:553
                 Object#__script__ at kernel/loader.rb:565

But it works fine on 1.8.7

Ruby 1.9.1 + antlr3 1.7.5 - mismatched character "+"; expecting "+"?

Hi Kyle,
I'm running the 1.7.5 version of the antlr3 gem, and I'm constantly running into the same kind of problem (it might just be because I'm a noob at antlr!)
I tried running your example code.

In file "AddingMachine.g" I put the following grammar:

grammar AddingMachine;

options {
  language = Ruby;
}

expression returns[ value ]
  : a=NUMBER '+' b=NUMBER { $value = $a.text.to_i + $b.text.to_i }
  | a=NUMBER '-' b=NUMBER { $value = $a.text.to_i - $b.to_i }
  ;

NUMBER: ( '0' .. '9' )+;

SPACE: ' '+ { $channel = HIDDEN };

To test it, I created a file "AddingMachine.rb" which contains:

require "rubygems"
require "AddingMachineLexer"
require "AddingMachineParser"

lexer = AddingMachine::Lexer.new( "1 + 1" )
tokens = ANTLR3::CommonTokenStream.new( lexer )
parser = AddingMachine::Parser.new( tokens )

I ran "antlr4ruby AddingMachine.g" to generate the lexer and parser files. Then when I ran "ruby AddingMachine.rb" however, I got the following error:

line 1:1 mismatched character " "; expecting " "
line 1:2 mismatched character "+"; expecting "+"
line 1:3 mismatched character " "; expecting " "
/home/cadmium/ruby/antlr/AddingMachineLexer.rb:162:in `between?': comparison of Fixnum with String failed (ArgumentError)
    from /home/cadmium/ruby/antlr/AddingMachineLexer.rb:162:in `number!'
    from /home/cadmium/ruby/antlr/AddingMachineLexer.rb:272:in `token!'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/recognizers.rb:980:in `block in next_token'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/recognizers.rb:971:in `loop'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/recognizers.rb:971:in `next_token'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/token.rb:291:in `next'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/token.rb:306:in `block in each'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/token.rb:306:in `loop'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/token.rb:306:in `each'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/streams.rb:749:in `to_a'
    from /var/lib/gems/1.9.1/gems/antlr3-1.7.5/lib/antlr3/streams.rb:749:in `initialize'
    from AddingMachine.rb:6:in `new'
    from AddingMachine.rb:6:in `'

I'm at a loss to understand what's going on so I'm hoping it makes sense to you! Did I make a mistake in how to use antlr3?

Thanks very much in advance,
Cadmium.

Exception when run "antlr4ruby" in Mac

Dear Kyle,

The software is great. Thanks for writing and sharing it.

I've just updated my gem from 1.8.12 to 1.8.13. But whenever I tried to run "antlr4ruby" script to generate the Ruby codes from my grammar, I got this exception:
----- begin of exception ----
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/antlr/codegen/RubyTarget : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:171)
at org.antlr.codegen.CodeGenerator.loadLanguageTarget(CodeGenerator.java:169)
at org.antlr.codegen.CodeGenerator.(CodeGenerator.java:163)
at org.antlr.Tool.generateRecognizer(Tool.java:630)
at org.antlr.Tool.process(Tool.java:455)
at org.antlr.Tool.main(Tool.java:89)
----- end of exception -----

I've never had this exception when using the previous version (1.8.12). You could reproduce this exception using my grammar:
https://github.com/herry13/sfp-ruby/blob/master/src/SfpLang.g

Looking forward for your response. Thanks.

Regards,
Herry

Module Wrapper

Hi,

How can I wrap the generated code for a provided grammar to a particular module? For example:

lexer grammar SqlSplitter;

options {
  filter=true;
  language='Ruby';
}

@lexer::header {
    module MyModule
}

...

complains, obviously, that the end clause for my declared module is missing. The reason I ask is that I don't want to pollute the global namespace with various modules but to include them in a well known module. Sorry in advance if this is already documented and I just didn't manage to find this information. By the way, antlr3 for ruby is great!

Thanks!

Template output example

Hi! Can you provide some example how to work with templates, please? Just, how to load erb template and use it in grammar... Thanks in advance.

bug in CommonTreeNodeStream

Dear Kyle,

First of all, thanks for writing this great code!

I think I've stumbled across a little bug in your target code though. I believe that the CommonTreeNodeStream should expose the @last_marker instance variable via an attr_reader. This is needed when tree grammars generate DFAs. The initialize_dfas method calls @input.rewind(@input.last_marker, false) which can only work if last_marker is accessible for CommonTreeNodeStream.

example, taken from generated tree parser ruby code:

      @dfa1 = DFA1.new( self, 1 ) do |s| 
        case s
        when 0
          look_1_2 = @input.peek
          index_1_2 = @input.index
          @input.rewind( @input.last_marker, false )
          s = -1

Another possibility is to fix the the generated parser code to call @input.rewind without arguments, since last_marker is the default argument of this method.

Thanks,

omar

PS. here is a patch, I don't know how to attach a file (or what is the proper github way)

--- a/orig/tree.rb
+++ b/fixed/tree.rb
@@ -1107,6 +1107,8 @@ class CommonTreeNodeStream
     return @last_marker
   end

+  attr_reader :last_marker
+  
   def release( marker = nil )
     # do nothing?
   end

rake doc Graphviz dependency

in readme say and/or in scripts warn about Graphviz is used to get a really cool dynamic navigation in doc ...

i like the graphs and do not mind the dependency but rake doc gave me errors without clean statements of a dependency to a lib not by default included ... scattered around is mention of dot and such ... in a first clean install it should be set to clearly state of dependency to build or have a .png replacing the dynamic one ... and refuting err in doc html generation ...

Composite Grammar

I would like to build a grammar from several lexer files so to warm up I tried the following:

//Root.g
grammar Root;
options { language = Ruby; }
import Delegate;
a : 'int' ID ;

//Delgate.g
lexer grammar Delegate;
options { language = Ruby; }
ID : 'a'..'z'+ ;
INT : '0'..'9'+ ;
WS : (' '|'\n')+ {skip();} ;

and got the following messages:

me@mycomputer:~$ antlr4ruby Root.g
warning(24): template error: context [/outputFile /rootGrammarOutputFile /lexer /_sub155 /delegateLexerRule] 3:94 no such property or can't access: null.attributes

It seems that antrl3.2 does not support composite grammar for ruby.

me@mycomputer:~$ antlr3 Root.g
error(10): internal error: group Ruby does not satisfy interface ANTLRCore: mismatched arguments on these templates [treeParser(grammar, name, scopes, tokens, tokenNames, globalAction, rules, numRules, bitsets, labelType, ASTLabelType, superClass, members, filterMode)]

So what options do I have?

Test rig failure

I tried running the examples from the antlr book and used the default test rig (passing the generated files to ruby directly). It worked fine for the simple grammar but is failing now for the tree parser. This is the error message I got:

$ ruby Eval.rb
~/.rvm/gems/ruby-1.9.3-p0@cg/gems/antlr3-1.8.12/lib/antlr3/main.rb:549:in `setup': unable to locate the lexer class  (RuntimeError)
    from ~/.rvm/gems/ruby-1.9.3-p0@cg/gems/antlr3-1.8.12/lib/antlr3/main.rb:137:in `execute'
    from ~/.rvm/gems/ruby-1.9.3-p0@cg/gems/antlr3-1.8.12/lib/antlr3/tree.rb:108:in `main'
    from Eval.rb:363:in `block in <module:Eval>'

The file is copied from the antler book and modified to output ruby code:

tree grammar Eval;

options {
language = Ruby;
tokenVocab = Expr;
ASTLabelType = CommonTree;
}

@members{
memory = {}
}

prog: stat+ ;

stat
    : expr { puts $expr.value }
    | ^('=' ID expr) { memory[$ID.text] = $expr.value.to_i }
    ;

expr returns [value]
    : ^('+' a=expr b=expr) {$value = a+b}
    | ^('-' a=expr b=expr) {$value = a-b}
    | ^('*' a=expr b=expr) {$value = a*b}
    | ID
        {
        v = memory[$ID.text].to_i
        if !v.nil? then
          $value = v
        else
          puts "undefined variable " + $ID.text
        end
        }
    | INT { $value = $INT.text.to_i }
    ;

Is this a bug in the code or am I doing something wrong?

FreeBSD does not define SOL_TCP, and so cannot remotely debug grammars

Really impressive gem. This has to be a hairy integration with antlr, and it's clean as hell.

The title says it all, really. Socket::SOL_TCP doesn't exist on FreeBSD (and probably other) systems, so after connecting to debug remotely, the parser dies and I get a stack trace like this.

Parsing itself is working great for me, but I want to be able to debug so badly with antlrworks.

Patch (v 1.8.11) for cygwin causes issues on (some) non-cygwin envs

Hi there - First, thanks for all the amazing work on Antlr 4 Ruby -- we're loving it :)

The latest patch (v 1.8.11: added patch to fix antlr4ruby script on cygwin) causes an error in our environment and I'm not sure if it just our configuration or something others are experiencing. We don't use cygwin, but are on Windows. Here is the error when trying to run antlr4ruby:

C:/Ruby187/lib/ruby/gems/1.8/gems/antlr3-1.8.11/bin/antlr4ruby:87:in ``': No such file or directory - cygpath -aw C:/Ruby187/lib/ruby/gems/1.8/gems/antlr3-1.8.11/java/antlr-full-3.2.1.jar (Errno::ENOENT)
from C:/Ruby187/lib/ruby/gems/1.8/gems/antlr3-1.8.11/bin/antlr4ruby:87
from C:/Ruby187/lib/ruby/gems/1.8/bin/antlr4ruby:19:in`load'
from C:/Ruby187/lib/ruby/gems/1.8/bin/antlr4ruby:19

Everything works great if we roll back to 1.8.10. Is the expectation that cygwin is now required for all mswin platforms?

I think this is the line that's maybe causing the trouble:

if /mswin32|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
jar = cygpath -aw #{jar}.strip
end

Thanks for any recommendations.

Sara

Issues with combined grammars

Hello.

When I try to make a combined grammar, importing a lexer (no matter what one), I get the following warnings:
/home/whitequark/korvin/lib/grammar/ModuleDefinitionLexer.rb:89: warning: already initialized constant RULE_NAMES
/home/whitequark/korvin/lib/grammar/ModuleDefinitionLexer.rb:90: warning: already initialized constant RULE_METHODS

Moreover, running lexer interactively (like ruby ModuleDefinitionLexer -I) results in following error:

ModuleDefinitionLexer:1> int
/home/whitequark/korvin/lib/grammar/ModuleDefinitionLexer.rb:160:in `between?': comparison of String with 9 failed (ArgumentError)
    from /home/whitequark/korvin/lib/grammar/ModuleDefinitionLexer.rb:160:in `token!'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/recognizers.rb:1029:in `block in next_token'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/recognizers.rb:1020:in `loop'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/recognizers.rb:1020:in `next_token'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/main.rb:329:in `block in recognize'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/main.rb:327:in `loop'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/main.rb:327:in `recognize'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/main.rb:218:in `execute_interactive'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/main.rb:139:in `execute'
    from /home/whitequark/.gem/ruby/1.9.1/gems/antlr3-1.8.2/lib/antlr3/recognizers.rb:994:in `main'
    from ModuleDefinitionLexer.rb:221:in `block in '

Parser has similar issues too.

Generated TreeParser seems to have wrong qualified base class

Hi,

I've tried to build a tree walker, but the generated code couldn't be loaded, due to an "uninitialized constant" failure for ANTLR3::TreeParser. Looking at the code revealed, that the generated TreeParser class is derived from ANTLR3::TreeParser, although this class is defined in the module ANTLR3::AST. Changing the generated class to derive from ANTLR3::AST::TreeParser solved the loading problem. Did I misunderstand something substantial or is it a bug in the template?

Thanks for the great tool,
Marcel

Contact info

Hi Kyle Yetter

How can we contact you for a business long term project (insurance app) which we are tend to choose rubyOnRails

email ?

best

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.