Java Doc for Parser.java in  » Scripting » FScript » murlen » util » fscript » 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 » FScript » murlen.util.fscript 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   murlen.util.fscript.Parser

Parser
final class Parser (Code)
Parser - Does the parsing - i.e it's the brains of the code.

Copyright (C) 2000-2003 murlen.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA


author:
   murlen
author:
   Joachim Van der Auwera
version:
   1.12
version:
   modifications by Joachim Van der Auwera
version:
   14.08.2001 added support for indexed variables
version:
   20.08.2001 -clean handling of setVar with null value
version:
   - cleaner handling of if with null condition
version:
   - make sure running empty script does nothing
version:
   - extra info when throwing an exception (with surrounding lines)
version:
   - changed operator prioritues for && and ||
version:
   - fixed bug in parseIf with handling of nesting of if clauses with else
version:
   - check for missing endif or endwhile (caused infinit loops)
version:
   - check for a null to prevernt excepion in parseExpr
version:
   28.08.2001
version:
   - call to host.getVar() replaced by host.F() (and added
version:
   proper exception handling, in that case)
version:
   31.08.2001
version:
   - test on if condition being of correct type re-introduced
version:
   10.09.2001
version:
   - added < <= > >= on strings
version:
   23.11.2001
version:
   - allow adding strings with anything
version:
   04.12.2001
version:
   - allow add/subtract/multiply/divide int with double
version:
   24.04.2002
version:
   - fixed a bug in parsing of nested if clause when one of the nested items contains a
version:
   "then" token with the statements on the next line(s) (test for TT_EOL instead of TT_EOF)
version:
   30.04.2002
version:
   - handle all exceptions on all getVarEntry, setVarEntry and callFunctionEntry calls
version:
   06.05.2002
version:
   - error messages now unique
version:
   - TT_EOF handled better in some cases
version:
   05-06.08.2002
version:
   - removed some redundant code
version:
   - introduced parseFunctionEnd to catch functions without return (it worked before, so...)
version:
   21.10.2002
version:
   - added == for FSObject instances
version:
   30.10.2002 object now allowed as function parameter
version:
   07.11.2002 better error handling when parsing an expression
version:
   20.11.2002 make != work for objects
version:
   15.03.2003 getContext() added JVDA
version:
   17.09.2003 removed checking for mismatched quotes and brackets, and moved to LineLoader
version:
   23.11.2003 recycle LexAnn objects (saves object allocation/release) JVDA
version:
   24.11.2003 some extra (smallish) speed improvements (also to reduce garbage a little bit)
version:
   25.02.2004
version:
   - proper evaluation of FSObject with contained boolean/integer for if/while
version:
   - more powerful compare for FSObject instance with something else
version:
   14.04.2004 elsif opperator support

Inner Class :class FuncEntry
Inner Class :class RetException extends Exception

Field Summary
final public static  IntegerFS_FALSE
    
final public static  IntegerFS_TRUE
    

Constructor Summary
 Parser(FScript h)
    

Method Summary
 voidaddVar(String name, Object value)
    
 ObjectcallFunction(String name, ArrayList params)
    
public  StringgetContext()
    
 String[]getError()
    
public  ObjectgetVar(String name)
    
public  booleanhasVar(String name)
    
 Objectparse(int from, int to)
    
 Objectparse(String line)
    
 voidreset()
     Resets the parser state.
 voidsetCode(LineLoader in)
    
public  voidsetVar(String name, Object val)
    

Field Detail
FS_FALSE
final public static Integer FS_FALSE(Code)



FS_TRUE
final public static Integer FS_TRUE(Code)




Constructor Detail
Parser
Parser(FScript h)(Code)
Public constructor
Parameters:
  h - a reference to the FScript object




Method Detail
addVar
void addVar(String name, Object value) throws FSException(Code)



callFunction
Object callFunction(String name, ArrayList params) throws IOException, FSException(Code)



getContext
public String getContext()(Code)
get the current context (executed line, variables etc)



getError
String[] getError()(Code)



getVar
public Object getVar(String name)(Code)



hasVar
public boolean hasVar(String name)(Code)



parse
Object parse(int from, int to) throws IOException, FSException(Code)
The main parsing function
Parameters:
  from - - the start line number
Parameters:
  to - - the end line numberreturns an Object (currently a Integer or String) dependingon the return value of the code parsed, or null if none.



parse
Object parse(String line) throws IOException, FSException(Code)
The main parsing function
Parameters:
  line - - the line to be parsed an Object depending on the return value of the code parsed, or null if none.



reset
void reset()(Code)
Resets the parser state.



setCode
void setCode(LineLoader in)(Code)
Sets the LineLoader clas to be used for input
Parameters:
  in - - the class



setVar
public void setVar(String name, Object val) throws FSException(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.