Java Doc for SyntaxPattern.java in  » Scripting » Kawa » kawa » lang » 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 » Kawa » kawa.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   kawa.lang.Pattern
      kawa.lang.SyntaxPattern

SyntaxPattern
public class SyntaxPattern extends Pattern implements Externalizable(Code)
This encodes a pattern from a Scheem syntax-case or syntax-rules.


Field Summary
final static  intMATCH_ANY
     The instruction 8*i+MATCH_ANY matches any form, It sets vars[i] to the matched form.
final static  intMATCH_ANY_CAR
     The instruction 8*i+MATCH_CAR matches the car of a Pair, It sets vars[i] to the Pair itself.
final static  intMATCH_EQUALS
     The instruction 8*i+MATCH_EQUALS matches the literal values literals[i].
final static  intMATCH_IGNORE
     Match anything and ignoe it.
final static  intMATCH_LENGTH
     The instruction 8*i+MATCH_LENGTH matches a pure list of length 2*i or an impure list of 2*i+1 pairs. It is followed by a pattern which must also match.
final static  intMATCH_LREPEAT
     The instruction 8*i+MATCH_LREPEAT matches a repeated pattern.
final static  intMATCH_MISC
     This 3-bit "opcode" is used for shorter operand-less instructions.
final static  intMATCH_NIL
     Matches List.Empty.
final static  intMATCH_PAIR
     The instruction 8*i+MATCH_PAIR matches a Pair. Its car must match the pattern at pc+1, while its cdr must match the mattern at pc+1+i.
final static  intMATCH_VECTOR
     Matches a vector (FVector). Matches a vecetor v if the following list pattern (at pc+1) matches (vector->list v).
final static  intMATCH_WIDE
     The instruction 8*i+MATCH_WIDE is a prefix. It causes i<<13 to be added to the parameter (i) of the following instruction.
 Object[]literals
    
 Stringprogram
     An encoding of the pattern in a compact form. This is a sequence of "matching instructions".
 intvarCount
    

Constructor Summary
public  SyntaxPattern(String program, Object[] literals, int varCount)
    
public  SyntaxPattern(Object pattern, Object[] literal_identifiers, Translator tr)
    
 SyntaxPattern(StringBuffer programbuf, Object pattern, SyntaxForm syntax, Object[] literal_identifiers, Translator tr)
    

Method Summary
public static  Object[]allocVars(int varCount, Object[] outer)
     The compiler calls this method to implement syntax-case.
public  voiddisassemble()
    
public  voiddisassemble(java.io.PrintWriter ps, Translator tr)
    
 voiddisassemble(java.io.PrintWriter ps, Translator tr, int start, int limit)
    
public static  Object[]getLiteralsList(Object list, SyntaxForm syntax, Translator tr)
     Parse the literals list in a syntax-rules or syntax-case.
public static  booleanliteralIdentifierEq(Object id1, ScopeExp sc1, Object literal2)
    
public static  booleanliteralIdentifierEq(Object id1, ScopeExp sc1, Object id2, ScopeExp sc2)
    
public  booleanmatch(Object obj, Object[] vars, int start_vars)
    
public  booleanmatch(Object obj, Object[] vars, int start_vars, int pc, SyntaxForm syntax)
    
 booleanmatch_car(Pair p, Object[] vars, int start_vars, int pc, SyntaxForm syntax)
     Match the car of a Pair. This special case (instead of of just matching the car directly), is so we can copy PairWithPosition line number info into the output of a template.
public  voidprint(Consumer out)
    
public  voidreadExternal(ObjectInput in)
    
 voidtranslate(Object pattern, StringBuffer program, Object[] literal_identifiers, int nesting, Vector literals, SyntaxForm syntax, char context, Translator tr)
    
public  intvarCount()
    
public  voidwriteExternal(ObjectOutput out)
    

Field Detail
MATCH_ANY
final static int MATCH_ANY(Code)
The instruction 8*i+MATCH_ANY matches any form, It sets vars[i] to the matched form.



MATCH_ANY_CAR
final static int MATCH_ANY_CAR(Code)
The instruction 8*i+MATCH_CAR matches the car of a Pair, It sets vars[i] to the Pair itself.



MATCH_EQUALS
final static int MATCH_EQUALS(Code)
The instruction 8*i+MATCH_EQUALS matches the literal values literals[i].



MATCH_IGNORE
final static int MATCH_IGNORE(Code)
Match anything and ignoe it.



MATCH_LENGTH
final static int MATCH_LENGTH(Code)
The instruction 8*i+MATCH_LENGTH matches a pure list of length 2*i or an impure list of 2*i+1 pairs. It is followed by a pattern which must also match.



MATCH_LREPEAT
final static int MATCH_LREPEAT(Code)
The instruction 8*i+MATCH_LREPEAT matches a repeated pattern. The repeated sub-pattern starts at pc+1, and is i chars long. Following that (at pc+1+i) is the index of the first pattern variable in the sub-pattern, followed by the count of pattern variables in the sub-pattern. (Both are shifted left by 3 in case we need MATCH_WIDE). This is followed either by a MATCH_NIL (in which case all remaining elements must match the repeated sub-pattern), or by a MATCH_LENGTH (which must match the tail).



MATCH_MISC
final static int MATCH_MISC(Code)
This 3-bit "opcode" is used for shorter operand-less instructions.



MATCH_NIL
final static int MATCH_NIL(Code)
Matches List.Empty.



MATCH_PAIR
final static int MATCH_PAIR(Code)
The instruction 8*i+MATCH_PAIR matches a Pair. Its car must match the pattern at pc+1, while its cdr must match the mattern at pc+1+i.



MATCH_VECTOR
final static int MATCH_VECTOR(Code)
Matches a vector (FVector). Matches a vecetor v if the following list pattern (at pc+1) matches (vector->list v).



MATCH_WIDE
final static int MATCH_WIDE(Code)
The instruction 8*i+MATCH_WIDE is a prefix. It causes i<<13 to be added to the parameter (i) of the following instruction.



literals
Object[] literals(Code)



program
String program(Code)
An encoding of the pattern in a compact form. This is a sequence of "matching instructions". These have a 3-bit "opcode", which is one of the MATCH_XXX cosntants. The leaves 13 bits available as an operand; if that isn't enough the MATCH_WIDE "instruction" can be used to modify the following instruction.



varCount
int varCount(Code)




Constructor Detail
SyntaxPattern
public SyntaxPattern(String program, Object[] literals, int varCount)(Code)



SyntaxPattern
public SyntaxPattern(Object pattern, Object[] literal_identifiers, Translator tr)(Code)



SyntaxPattern
SyntaxPattern(StringBuffer programbuf, Object pattern, SyntaxForm syntax, Object[] literal_identifiers, Translator tr)(Code)




Method Detail
allocVars
public static Object[] allocVars(int varCount, Object[] outer)(Code)
The compiler calls this method to implement syntax-case.



disassemble
public void disassemble()(Code)



disassemble
public void disassemble(java.io.PrintWriter ps, Translator tr)(Code)



disassemble
void disassemble(java.io.PrintWriter ps, Translator tr, int start, int limit)(Code)



getLiteralsList
public static Object[] getLiteralsList(Object list, SyntaxForm syntax, Translator tr)(Code)
Parse the literals list in a syntax-rules or syntax-case.



literalIdentifierEq
public static boolean literalIdentifierEq(Object id1, ScopeExp sc1, Object literal2)(Code)



literalIdentifierEq
public static boolean literalIdentifierEq(Object id1, ScopeExp sc1, Object id2, ScopeExp sc2)(Code)



match
public boolean match(Object obj, Object[] vars, int start_vars)(Code)



match
public boolean match(Object obj, Object[] vars, int start_vars, int pc, SyntaxForm syntax)(Code)



match_car
boolean match_car(Pair p, Object[] vars, int start_vars, int pc, SyntaxForm syntax)(Code)
Match the car of a Pair. This special case (instead of of just matching the car directly), is so we can copy PairWithPosition line number info into the output of a template.



print
public void print(Consumer out)(Code)



readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException(Code)



translate
void translate(Object pattern, StringBuffer program, Object[] literal_identifiers, int nesting, Vector literals, SyntaxForm syntax, char context, Translator tr)(Code)

Parameters:
  context - 'V' : vector elements; 'P' : car of Pair; '\0' : other.



varCount
public int varCount()(Code)



writeExternal
public void writeExternal(ObjectOutput out) throws IOException(Code)



Fields inherited from kawa.lang.Pattern
final public static Method matchPatternMethod(Code)(Java Doc)
public static ClassType typePattern(Code)(Java Doc)

Methods inherited from kawa.lang.Pattern
public Object[] match(Object obj)(Code)(Java Doc)
abstract public boolean match(Object obj, Object[] vars, int start_vars)(Code)(Java Doc)
abstract public int varCount()(Code)(Java Doc)

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.