Java Doc for lalr_item_set.java in  » Parser » CUP-develop » java_cup » 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 » CUP develop » java_cup 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java_cup.lalr_item_set

lalr_item_set
public class lalr_item_set (Code)
This class represents a set of LALR items. For purposes of building these sets, items are considered unique only if they have unique cores (i.e., ignoring differences in their lookahead sets).

This class provides fairly conventional set oriented operations (union, sub/super-set tests, etc.), as well as an LALR "closure" operation (see compute_closure()).
See Also:   java_cup.lalr_item
See Also:   java_cup.lalr_state
version:
   last updated: 3/6/96
author:
   Scott Hudson



Field Summary
protected  Hashtable_all
     A hash table to implement the set.
protected  Integerhashcode_cache
     Cached hashcode for this set.

Constructor Summary
public  lalr_item_set()
     Constructor for an empty set.
public  lalr_item_set(lalr_item_set other)
     Constructor for cloning from another set.

Method Summary
public  lalr_itemadd(lalr_item itm)
     Add a singleton item, merging lookahead sets if the item is already part of the set.
public  voidadd(lalr_item_set other)
    
public  Enumerationall()
     Access to all elements of the set.
public  voidcompute_closure()
     Compute the closure of the set using the LALR closure rules.
public  booleancontains(lalr_item itm)
    
public  booleanequals(lalr_item_set other)
     Equality comparison.
public  booleanequals(Object other)
     Generic equality comparison.
public  lalr_itemfind(lalr_item itm)
    
public  lalr_itemget_one()
     Remove and return one item from the set (done in hash order).
public  inthashCode()
     Return hash code.
public  booleanis_subset_of(lalr_item_set other)
    
public  booleanis_superset_of(lalr_item_set other)
    
protected  voidnot_null(Object obj)
     Helper function for null test.
public  voidremove(lalr_item itm)
     Remove a single item if it is in the set.
public  voidremove(lalr_item_set other)
     Remove (set subtract) a complete set.
public  intsize()
    
public  StringtoString()
     Convert to string.

Field Detail
_all
protected Hashtable _all(Code)
A hash table to implement the set. We store the items using themselves as keys.



hashcode_cache
protected Integer hashcode_cache(Code)
Cached hashcode for this set.




Constructor Detail
lalr_item_set
public lalr_item_set()(Code)
Constructor for an empty set.



lalr_item_set
public lalr_item_set(lalr_item_set other) throws internal_error(Code)
Constructor for cloning from another set.
Parameters:
  other - indicates set we should copy from.




Method Detail
add
public lalr_item add(lalr_item itm) throws internal_error(Code)
Add a singleton item, merging lookahead sets if the item is already part of the set. returns the element of the set that was added or merged into.
Parameters:
  itm - the item being added.



add
public void add(lalr_item_set other) throws internal_error(Code)
Add a complete set, merging lookaheads where items are already in the set
Parameters:
  other - the set to be added.



all
public Enumeration all()(Code)
Access to all elements of the set.



compute_closure
public void compute_closure() throws internal_error(Code)
Compute the closure of the set using the LALR closure rules. Basically for every item of the form:
 [L ::= a *N alpha, l] 
 
(where N is a a non terminal and alpha is a string of symbols) make sure there are also items of the form:
 [N ::= *beta, first(alpha l)] 
 
corresponding to each production of N. Items with identical cores but differing lookahead sets are merged by creating a new item with the same core and the union of the lookahead sets (the LA in LALR stands for "lookahead merged" and this is where the merger is). This routine assumes that nullability and first sets have been computed for all productions before it is called.



contains
public boolean contains(lalr_item itm)(Code)
Does the set contain a particular item?
Parameters:
  itm - the item in question.



equals
public boolean equals(lalr_item_set other)(Code)
Equality comparison.



equals
public boolean equals(Object other)(Code)
Generic equality comparison.



find
public lalr_item find(lalr_item itm)(Code)
Return the item in the set matching a particular item (or null if not found)
Parameters:
  itm - the item we are looking for.



get_one
public lalr_item get_one() throws internal_error(Code)
Remove and return one item from the set (done in hash order).



hashCode
public int hashCode()(Code)
Return hash code.



is_subset_of
public boolean is_subset_of(lalr_item_set other) throws internal_error(Code)
Is this set an (improper) subset of another?
Parameters:
  other - the other set in question.



is_superset_of
public boolean is_superset_of(lalr_item_set other) throws internal_error(Code)
Is this set an (improper) superset of another?
Parameters:
  other - the other set in question.



not_null
protected void not_null(Object obj) throws internal_error(Code)
Helper function for null test. Throws an interal_error exception if its parameter is null.
Parameters:
  obj - the object we are testing.



remove
public void remove(lalr_item itm) throws internal_error(Code)
Remove a single item if it is in the set.
Parameters:
  itm - the item to remove.



remove
public void remove(lalr_item_set other) throws internal_error(Code)
Remove (set subtract) a complete set.
Parameters:
  other - the set to remove.



size
public int size()(Code)
Size of the set



toString
public String toString()(Code)
Convert to string.



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.