Java Doc for ConsumerAlternatives.java in  » Parser » runcc » fri » patterns » interpreter » parsergenerator » lexer » 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 » Parser » runcc » fri.patterns.interpreter.parsergenerator.lexer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   fri.patterns.interpreter.parsergenerator.lexer.Consumer
      fri.patterns.interpreter.parsergenerator.lexer.ConsumerAlternatives

ConsumerAlternatives
class ConsumerAlternatives extends Consumer (Code)
Container for alternative rules/Consumers. If one of the contained consumers succeeds, the alternative succeeds, else it fails.
author:
   (c) 2002, Fritz Ritzberger



Constructor Summary
 ConsumerAlternatives(Consumer alternateConsumer)
     Create a list of alternative consumers, inserting passed consumer.

Method Summary
public  voidaddAlternate(Consumer alternateConsumer)
     Add another alternative consumer for same nonterminal.
protected  ResultTreeconsumeInternal(InputText input)
     Reads from input by delegating to a Strategy object.
Parameters:
  input - Input object where to read from.
public  ListgetAlternatives()
     Returns the stored alternative consumers that have the same nonterminal. This is for the Lexer to retrieve alternative consumers and call them explicitely to read input.
protected  intgetSomeLength(boolean exploreStartLength, List breakIndicator)
     Returns the maximum fixed length of all alternating consumers.
public  CharactergetStartCharacter()
     Returns the common start character if all alternatives have the same, else null.
public  intgetStartVariance()
     Returns 1 if start character exists, else the sum of possible start variances of all consumers (silently assuming that they have different character sets).
 booleanmatchesRepeatableRule(Rule rule)
     Tries to match to all alternates.
public  booleanoverlaps(Consumer cc)
     Returns true if the passed consumer could be concurrent with one of the contained alternatives.
public  voidsetStrategyFactoryMethod(StrategyFactoryMethod strategyFactoryMethod)
     Sets the factory for Strategy objects.
protected  StringtoStringBase()
     Returns the base string for toString() method.


Constructor Detail
ConsumerAlternatives
ConsumerAlternatives(Consumer alternateConsumer)(Code)
Create a list of alternative consumers, inserting passed consumer.




Method Detail
addAlternate
public void addAlternate(Consumer alternateConsumer)(Code)
Add another alternative consumer for same nonterminal.



consumeInternal
protected ResultTree consumeInternal(InputText input) throws IOException(Code)
Reads from input by delegating to a Strategy object.
Parameters:
  input - Input object where to read from. null if no match, else scanned input as a StringBuffer.



getAlternatives
public List getAlternatives()(Code)
Returns the stored alternative consumers that have the same nonterminal. This is for the Lexer to retrieve alternative consumers and call them explicitely to read input. This must be done to match the longest input.



getSomeLength
protected int getSomeLength(boolean exploreStartLength, List breakIndicator)(Code)
Returns the maximum fixed length of all alternating consumers. A fixed start sequence ends at the first found character set (like "0..9").

Returns the maximum start length of all alternating consumers. A consumer start length ends at the first found repeatable or nullable consumer (like "chars*").




getStartCharacter
public Character getStartCharacter()(Code)
Returns the common start character if all alternatives have the same, else null.



getStartVariance
public int getStartVariance()(Code)
Returns 1 if start character exists, else the sum of possible start variances of all consumers (silently assuming that they have different character sets).



matchesRepeatableRule
boolean matchesRepeatableRule(Rule rule)(Code)
Tries to match to all alternates. Returns true when at least one succeeds.



overlaps
public boolean overlaps(Consumer cc)(Code)
Returns true if the passed consumer could be concurrent with one of the contained alternatives.



setStrategyFactoryMethod
public void setStrategyFactoryMethod(StrategyFactoryMethod strategyFactoryMethod)(Code)
Sets the factory for Strategy objects.



toStringBase
protected String toStringBase()(Code)
Returns the base string for toString() method.



Fields inherited from fri.patterns.interpreter.parsergenerator.lexer.Consumer
protected int fixedLengthstartLengthvariance(Code)(Java Doc)
protected Rule rule(Code)(Java Doc)

Methods inherited from fri.patterns.interpreter.parsergenerator.lexer.Consumer
public void append(String charOrString)(Code)(Java Doc)
public void append(Reference subConsumer)(Code)(Java Doc)
public void append(Consumer subConsumer)(Code)(Java Doc)
public void appendSet(String high) throws LexerException(Code)(Java Doc)
public int compareTo(Object o)(Code)(Java Doc)
public ResultTree consume(InputText input) throws IOException(Code)(Java Doc)
protected ResultTree consumeInternal(InputText input) throws IOException(Code)(Java Doc)
public List getAlternatives()(Code)(Java Doc)
public int getFixedLength()(Code)(Java Doc)
protected int getSomeLength(boolean exploreStartLength, List breakIndicator)(Code)(Java Doc)
public Character getStartCharacter()(Code)(Java Doc)
public int getStartLength()(Code)(Java Doc)
public int getStartVariance()(Code)(Java Doc)
public boolean isNullable()(Code)(Java Doc)
public boolean isRepeatable()(Code)(Java Doc)
protected void listToString(List list, StringBuffer sb, String separator, boolean separatorAtFirst)(Code)(Java Doc)
boolean matchesRepeatableRule(Rule rule)(Code)(Java Doc)
Consumer optimize()(Code)(Java Doc)
public boolean overlaps(Consumer cc)(Code)(Java Doc)
public void resolveConsumerReferences(Map charConsumers, Map doneList) throws LexerException(Code)(Java Doc)
public void setNullable()(Code)(Java Doc)
public void setRepeatable()(Code)(Java Doc)
public void setStrategyFactoryMethod(StrategyFactoryMethod strategyFactoryMethod)(Code)(Java Doc)
public void subtract(Consumer constraint)(Code)(Java Doc)
public void subtract(Reference constraint)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected String toStringBase()(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.