Java Doc for SimpleSExprStream.java in  » Web-Server » Jigsaw » org » w3c » tools » sexpr » 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 » Web Server » Jigsaw » org.w3c.tools.sexpr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.io.PushbackInputStream
   org.w3c.tools.sexpr.SimpleSExprStream

SimpleSExprStream
public class SimpleSExprStream extends PushbackInputStream implements SExprStream(Code)
Basic implementation of the SExprStream parser interface.



Constructor Summary
public  SimpleSExprStream(InputStream input)
     Initializes the parser with no read table and no symbol table assigned.

Method Summary
public  SExprParseraddParser(char key, SExprParser parser)
     Associates a dispatch character with a parser in the read table.
public  booleangetListsAsVectors()
     Checks whether lists should be parsed as Vectors or Cons cells.
public  ReadtablegetReadtable()
     Accesses the read table of the parser.
public  StringBuffergetScratchBuffer()
     Accesses an empty string buffer available temporary storage. This buffer can be used by sub-parsers as a scratch area.
public  DictionarygetSymbols()
     Accesses the symbol table of the parser.
protected  booleanisAtomChar(char c, boolean first)
     Predicate function for checking if a chahracter can belong to an atom.
public static  voidmain(String args)
    
protected  NumbermakeNumber(String s)
     Attempts to parse a number from the string.
public  Objectparse()
     Parses a single object from the underlying input stream.
public  Objectparse(char c, SExprStream stream)
     Parses a single object started by the character c.
protected  ObjectparseAtom(char c)
     Parses an atom (a number or a symbol). Since anything that is not a number is a symbol, syntax errors are not possible.
exception:
  SExprParserException - not signalled but useful for the protocol
exception:
  IOException - if an I/O problem occurred (e.g.
protected  ConsparseList()
     Parses a list (as Cons cells) sans first character.
public  StringparseString()
     Parses a double-quote -delimited string (sans the first character). Please note: no escape-character interpretation is performed.
protected  VectorparseVector(Vector vector, char delimiter)
     Parses a list (as a Vector) sans first character.
public static  voidprintExpr(Object expr, PrintStream out)
     Produces a printed representation of an s-expression.
public  charreadSkipWhite()
     Reads from the stream, skipping whitespace and comments.
public  booleansetListsAsVectors(boolean listsAsVectors)
     Controls whether lists are represented as Vectors or Cons cells.
public  ReadtablesetReadtable(Readtable readtable)
     Assigns a new read table to the parser.
public  DictionarysetSymbols(Dictionary symbols)
     Assigns a symbol table to the parser.


Constructor Detail
SimpleSExprStream
public SimpleSExprStream(InputStream input)(Code)
Initializes the parser with no read table and no symbol table assigned. Parsed lists will be represented as Cons cells.




Method Detail
addParser
public SExprParser addParser(char key, SExprParser parser)(Code)
Associates a dispatch character with a parser in the read table.



getListsAsVectors
public boolean getListsAsVectors()(Code)
Checks whether lists should be parsed as Vectors or Cons cells.



getReadtable
public Readtable getReadtable()(Code)
Accesses the read table of the parser. If no read table has been assigned, creates an empty table.



getScratchBuffer
public StringBuffer getScratchBuffer()(Code)
Accesses an empty string buffer available temporary storage. This buffer can be used by sub-parsers as a scratch area. Please note that the buffer is not guarded in any way, so multithreaded and reentrant programs must worry about this themselves.



getSymbols
public Dictionary getSymbols()(Code)
Accesses the symbol table of the parser. If no symbol table has been assigned, creates an empty table.



isAtomChar
protected boolean isAtomChar(char c, boolean first)(Code)
Predicate function for checking if a chahracter can belong to an atom.
Parameters:
  first - if true means that c is the first character of the atom



main
public static void main(String args) throws SExprParserException, IOException(Code)



makeNumber
protected Number makeNumber(String s) throws NumberFormatException(Code)
Attempts to parse a number from the string.
exception:
  NumberFormatException - the string does not represent a number



parse
public Object parse() throws SExprParserException, IOException(Code)
Parses a single object from the underlying input stream.
exception:
  SExprParserException - if syntax error was detected
exception:
  IOException - if any other I/O-related problem occurred



parse
public Object parse(char c, SExprStream stream) throws SExprParserException, IOException(Code)
Parses a single object started by the character c. Implements the SExprParser interface.
exception:
  SExprParserException - if syntax error was detected
exception:
  IOException - if any other I/O-related problem occurred



parseAtom
protected Object parseAtom(char c) throws SExprParserException, IOException(Code)
Parses an atom (a number or a symbol). Since anything that is not a number is a symbol, syntax errors are not possible.
exception:
  SExprParserException - not signalled but useful for the protocol
exception:
  IOException - if an I/O problem occurred (e.g. end of file)



parseList
protected Cons parseList() throws SExprParserException, IOException(Code)
Parses a list (as Cons cells) sans first character.
exception:
  SExprParserException - if syntax error was detected
exception:
  IOException - if any other I/O-related problem occurred



parseString
public String parseString() throws SExprParserException, IOException(Code)
Parses a double-quote -delimited string (sans the first character). Please note: no escape-character interpretation is performed. Override this method for any escape character handling.
exception:
  SExprParserException - not signalled but useful for the protocol
exception:
  IOException - any I/O problem (including end of file)



parseVector
protected Vector parseVector(Vector vector, char delimiter) throws SExprParserException, IOException(Code)
Parses a list (as a Vector) sans first character. In order to parse list-like structures delimited by other characters than parentheses, the delimiting (ending) character has to be provided.
exception:
  SExprParserException - if syntax error was detected
exception:
  IOException - if any other I/O-related problem occurred



printExpr
public static void printExpr(Object expr, PrintStream out)(Code)
Produces a printed representation of an s-expression.



readSkipWhite
public char readSkipWhite() throws IOException(Code)
Reads from the stream, skipping whitespace and comments.
exception:
  IOException - if an I/O problem occurred (including end of file)



setListsAsVectors
public boolean setListsAsVectors(boolean listsAsVectors)(Code)
Controls whether lists are represented as Vectors or Cons cells.



setReadtable
public Readtable setReadtable(Readtable readtable)(Code)
Assigns a new read table to the parser.



setSymbols
public Dictionary setSymbols(Dictionary symbols)(Code)
Assigns a symbol table to the parser. Assigning null will prevent an empty symbol table to be created in the future.



Fields inherited from java.io.PushbackInputStream
protected byte[] buf(Code)(Java Doc)
protected int pos(Code)(Java Doc)

Methods inherited from java.io.PushbackInputStream
public int available() throws IOException(Code)(Java Doc)
public synchronized void close() throws IOException(Code)(Java Doc)
public synchronized void mark(int readlimit)(Code)(Java Doc)
public boolean markSupported()(Code)(Java Doc)
public int read() throws IOException(Code)(Java Doc)
public int read(byte[] b, int off, int len) throws IOException(Code)(Java Doc)
public synchronized void reset() throws IOException(Code)(Java Doc)
public long skip(long n) throws IOException(Code)(Java Doc)
public void unread(int b) throws IOException(Code)(Java Doc)
public void unread(byte[] b, int off, int len) throws IOException(Code)(Java Doc)
public void unread(byte[] b) throws IOException(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.