Java Doc for Parser.java in  » Scripting » beanshell » bsh » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » beanshell » bsh 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   bsh.Parser

Parser
public class Parser implements ParserTreeConstants,ParserConstants(Code)
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)
 }
 

Inner Class :final static class JJCalls

Field Summary
 JavaCharStreamjj_input_stream
    
protected  JJTParserStatejjtree
    
public  booleanlookingAhead
    
 booleanretainComments
    
public  ParserTokenManagertoken_source
    
public  Tokentokenjj_nt
    

Constructor Summary
public  Parser(java.io.InputStream stream)
    
public  Parser(java.io.Reader stream)
    
public  Parser(ParserTokenManager tm)
    

Method Summary
final public  voidAdditiveExpression()
    
final public  voidAllocationExpression()
    
final public  voidAmbiguousName()
    
final public  voidAndExpression()
    
final public  voidArgumentList()
    
final public  voidArguments()
    
final public  voidArrayDimensions()
    
final public  voidArrayInitializer()
    
final public  voidAssignment()
    
final public  intAssignmentOperator()
    
final public  voidBlock()
    
final public  voidBlockStatement()
    
final public  booleanBooleanLiteral()
    
final public  voidBreakStatement()
    
final public  voidCastExpression()
    
final public  voidCastLookahead()
    
final public  voidClassDeclaration()
    
final public  voidConditionalAndExpression()
    
final public  voidConditionalExpression()
    
final public  voidConditionalOrExpression()
    
final public  voidContinueStatement()
    
final public  voidDoStatement()
    
final public  voidEmptyStatement()
    
final public  voidEnhancedForStatement()
    
final public  voidEqualityExpression()
    
final public  voidExclusiveOrExpression()
    
final public  voidExpression()
    
final public  voidForInit()
    
final public  voidForStatement()
    
final public  voidForUpdate()
    
final public  voidFormalComment()
    
final public  voidFormalParameter()
    
final public  voidFormalParameters()
    
final public  voidIfStatement()
    
final public  voidImportDeclaration()
    
final public  voidInclusiveOrExpression()
    
final public  voidInstanceOfExpression()
    
final public  voidLabeledStatement()
    
final public  booleanLine()
    
final public  voidLiteral()
    
final public  voidMethodDeclaration()
    
final public  voidMethodInvocation()
    
final public  ModifiersModifiers(int context, boolean lookahead)
    
final public  voidMultiplicativeExpression()
    
final public  intNameList()
    
final public  voidNullLiteral()
    
final public  voidPackageDeclaration()
    
final public  voidPostfixExpression()
    
final public  voidPreDecrementExpression()
    
final public  voidPreIncrementExpression()
    
final public  voidPrimaryExpression()
    
final public  voidPrimaryPrefix()
    
final public  voidPrimarySuffix()
    
final public  voidPrimitiveType()
    
public  voidReInit(java.io.InputStream stream)
    
public  voidReInit(java.io.Reader stream)
    
public  voidReInit(ParserTokenManager tm)
    
final public  voidRelationalExpression()
    
final public  voidReturnStatement()
    
final public  voidReturnType()
    
final public  voidShiftExpression()
    
final public  voidStatement()
    
final public  voidStatementExpression()
    
final public  voidStatementExpressionList()
    
final public  voidSwitchLabel()
    
final public  voidSwitchStatement()
    
final public  voidSynchronizedStatement()
    
final public  voidThrowStatement()
    
final public  voidTryStatement()
    
final public  voidType()
    
final public  voidTypedVariableDeclaration()
     Declared a typed variable.
final public  voidUnaryExpression()
    
final public  voidUnaryExpressionNotPlusMinus()
    
final public  voidVariableDeclarator()
    
final public  voidVariableInitializer()
    
final public  voidVoidLiteral()
    
final public  voidWhileStatement()
    
 ParseExceptioncreateParseException(String message)
     Generate a ParseException with the specified message, pointing to the current token.
final public  voiddisable_tracing()
    
final public  voidenable_tracing()
    
public  ParseExceptiongenerateParseException()
    
final public  TokengetNextToken()
    
final public  TokengetToken(int index)
    
 booleanisRegularForStatement()
     Lookahead for the enhanced for statement.
 voidjjtreeCloseNodeScope(Node n)
    
 voidjjtreeOpenNodeScope(Node n)
    
public static  voidmain(String[] args)
    
public  SimpleNodepopNode()
    
 voidreInitInput(Reader in)
     Re-initialize the input stream and token source.
 voidreInitTokenInput(Reader in)
     Explicitly re-initialize just the token reader. This seems to be necessary to avoid certain looping errors when reading bogus input.
public  voidsetRetainComments(boolean b)
    

Field Detail
jj_input_stream
JavaCharStream jj_input_stream(Code)



jjtree
protected JJTParserState jjtree(Code)



lookingAhead
public boolean lookingAhead(Code)



retainComments
boolean retainComments(Code)



token_source
public ParserTokenManager token_source(Code)



tokenjj_nt
public Token tokenjj_nt(Code)




Constructor Detail
Parser
public Parser(java.io.InputStream stream)(Code)



Parser
public Parser(java.io.Reader stream)(Code)



Parser
public Parser(ParserTokenManager tm)(Code)




Method Detail
AdditiveExpression
final public void AdditiveExpression() throws ParseException(Code)



AllocationExpression
final public void AllocationExpression() throws ParseException(Code)



AmbiguousName
final public void AmbiguousName() throws ParseException(Code)



AndExpression
final public void AndExpression() throws ParseException(Code)



ArgumentList
final public void ArgumentList() throws ParseException(Code)



Arguments
final public void Arguments() throws ParseException(Code)



ArrayDimensions
final public void ArrayDimensions() throws ParseException(Code)



ArrayInitializer
final public void ArrayInitializer() throws ParseException(Code)



Assignment
final public void Assignment() throws ParseException(Code)



AssignmentOperator
final public int AssignmentOperator() throws ParseException(Code)



Block
final public void Block() throws ParseException(Code)



BlockStatement
final public void BlockStatement() throws ParseException(Code)



BooleanLiteral
final public boolean BooleanLiteral() throws ParseException(Code)



BreakStatement
final public void BreakStatement() throws ParseException(Code)



CastExpression
final public void CastExpression() throws ParseException(Code)



CastLookahead
final public void CastLookahead() throws ParseException(Code)



ClassDeclaration
final public void ClassDeclaration() throws ParseException(Code)



ConditionalAndExpression
final public void ConditionalAndExpression() throws ParseException(Code)



ConditionalExpression
final public void ConditionalExpression() throws ParseException(Code)



ConditionalOrExpression
final public void ConditionalOrExpression() throws ParseException(Code)



ContinueStatement
final public void ContinueStatement() throws ParseException(Code)



DoStatement
final public void DoStatement() throws ParseException(Code)



EmptyStatement
final public void EmptyStatement() throws ParseException(Code)



EnhancedForStatement
final public void EnhancedForStatement() throws ParseException(Code)



EqualityExpression
final public void EqualityExpression() throws ParseException(Code)



ExclusiveOrExpression
final public void ExclusiveOrExpression() throws ParseException(Code)



Expression
final public void Expression() throws ParseException(Code)



ForInit
final public void ForInit() throws ParseException(Code)



ForStatement
final public void ForStatement() throws ParseException(Code)



ForUpdate
final public void ForUpdate() throws ParseException(Code)



FormalComment
final public void FormalComment() throws ParseException(Code)



FormalParameter
final public void FormalParameter() throws ParseException(Code)



FormalParameters
final public void FormalParameters() throws ParseException(Code)



IfStatement
final public void IfStatement() throws ParseException(Code)



ImportDeclaration
final public void ImportDeclaration() throws ParseException(Code)



InclusiveOrExpression
final public void InclusiveOrExpression() throws ParseException(Code)



InstanceOfExpression
final public void InstanceOfExpression() throws ParseException(Code)



LabeledStatement
final public void LabeledStatement() throws ParseException(Code)



Line
final public boolean Line() throws ParseException(Code)



Literal
final public void Literal() throws ParseException(Code)



MethodDeclaration
final public void MethodDeclaration() throws ParseException(Code)



MethodInvocation
final public void MethodInvocation() throws ParseException(Code)



Modifiers
final public Modifiers Modifiers(int context, boolean lookahead) throws ParseException(Code)
THE JAVA LANGUAGE GRAMMAR STARTS HERE *



MultiplicativeExpression
final public void MultiplicativeExpression() throws ParseException(Code)



NameList
final public int NameList() throws ParseException(Code)



NullLiteral
final public void NullLiteral() throws ParseException(Code)



PackageDeclaration
final public void PackageDeclaration() throws ParseException(Code)



PostfixExpression
final public void PostfixExpression() throws ParseException(Code)



PreDecrementExpression
final public void PreDecrementExpression() throws ParseException(Code)



PreIncrementExpression
final public void PreIncrementExpression() throws ParseException(Code)



PrimaryExpression
final public void PrimaryExpression() throws ParseException(Code)



PrimaryPrefix
final public void PrimaryPrefix() throws ParseException(Code)



PrimarySuffix
final public void PrimarySuffix() throws ParseException(Code)



PrimitiveType
final public void PrimitiveType() throws ParseException(Code)



ReInit
public void ReInit(java.io.InputStream stream)(Code)



ReInit
public void ReInit(java.io.Reader stream)(Code)



ReInit
public void ReInit(ParserTokenManager tm)(Code)



RelationalExpression
final public void RelationalExpression() throws ParseException(Code)



ReturnStatement
final public void ReturnStatement() throws ParseException(Code)



ReturnType
final public void ReturnType() throws ParseException(Code)



ShiftExpression
final public void ShiftExpression() throws ParseException(Code)



Statement
final public void Statement() throws ParseException(Code)



StatementExpression
final public void StatementExpression() throws ParseException(Code)



StatementExpressionList
final public void StatementExpressionList() throws ParseException(Code)



SwitchLabel
final public void SwitchLabel() throws ParseException(Code)



SwitchStatement
final public void SwitchStatement() throws ParseException(Code)



SynchronizedStatement
final public void SynchronizedStatement() throws ParseException(Code)



ThrowStatement
final public void ThrowStatement() throws ParseException(Code)



TryStatement
final public void TryStatement() throws ParseException(Code)



Type
final public void Type() throws ParseException(Code)



TypedVariableDeclaration
final public void TypedVariableDeclaration() throws ParseException(Code)
Declared a typed variable. Untyped variables are not declared per-se but are handled by the part of the grammar that deals with assignments.



UnaryExpression
final public void UnaryExpression() throws ParseException(Code)



UnaryExpressionNotPlusMinus
final public void UnaryExpressionNotPlusMinus() throws ParseException(Code)



VariableDeclarator
final public void VariableDeclarator() throws ParseException(Code)



VariableInitializer
final public void VariableInitializer() throws ParseException(Code)



VoidLiteral
final public void VoidLiteral() throws ParseException(Code)



WhileStatement
final public void WhileStatement() throws ParseException(Code)



createParseException
ParseException createParseException(String message)(Code)
Generate a ParseException with the specified message, pointing to the current token. The auto-generated Parser.generateParseException() method does not provide line number info, therefore we do this.



disable_tracing
final public void disable_tracing()(Code)



enable_tracing
final public void enable_tracing()(Code)



generateParseException
public ParseException generateParseException()(Code)



getNextToken
final public Token getNextToken()(Code)



getToken
final public Token getToken(int index)(Code)



isRegularForStatement
boolean isRegularForStatement()(Code)
Lookahead for the enhanced for statement. Expect "for" "(" and then see whether we hit ":" or a ";" first.



jjtreeCloseNodeScope
void jjtreeCloseNodeScope(Node n)(Code)



jjtreeOpenNodeScope
void jjtreeOpenNodeScope(Node n)(Code)



main
public static void main(String[] args) throws IOException, ParseException(Code)



popNode
public SimpleNode popNode()(Code)



reInitInput
void reInitInput(Reader in)(Code)
Re-initialize the input stream and token source.



reInitTokenInput
void reInitTokenInput(Reader in)(Code)
Explicitly re-initialize just the token reader. This seems to be necessary to avoid certain looping errors when reading bogus input. See Interpreter.



setRetainComments
public void setRetainComments(boolean b)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.