Module jEdit

Class Parser

java.lang.Object
org.gjt.sp.jedit.bsh.Parser
All Implemented Interfaces:
ParserConstants, ParserTreeConstants

public class Parser extends Object implements ParserTreeConstants, ParserConstants
This is the BeanShell parser. It is used internally by the Interpreter class (which is probably what you are looking for). The parser knows only how to parse the structure of the language, it does not understand names, commands, etc.

You can use the Parser from the command line to do basic structural validation of BeanShell files without actually executing them. e.g. java bsh.Parser [ -p ] file [ file ] [ ... ]

The -p option causes the abstract syntax to be printed.

From code you'd use the Parser like this:

Parser parser = new Parser(in); while( !(eof=parser.Line()) ) { SimpleNode node = parser.popNode(); // use the node, etc. (See bsh.BSH* classes) }