vpm
vpm

Reputation: 19

Creating a JRuby parser implementation to generate AST from java file

I am currently trying to parse the following java code to get an AST from my .java files in a jrubyparser implementation:

import static org.junit.Assert.*;
import org.junit.Test;

public class testDeposit {

    public void test() {

        BankApplication b = new BankApplication();
        b.deposit("11117", "10.00");
        assertEquals("330.00", b.getAccountBalance("Seetha"));

    }

}

However when I run the code, it gives me the following error:

I have looked for the error information online but could not find anything regarding this error. Could anyone please explain what might be going wrong?

Thank you!

The following link is the repository for the jrubyparser that I am trying to use: https://github.com/jruby/jruby-parser

Upvotes: 0

Views: 203

Answers (1)

Jörg W Mittag
Jörg W Mittag

Reputation: 369458

The JRuby Ruby parser complains because the code you are parsing is not valid Ruby. It looks rather like Java to me.

Upvotes: 2

Related Questions