Source Code Cross Referenced for Symbol.java in  » Template-Engine » bte » java_cup » runtime » 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 » Template Engine » bte » java_cup.runtime 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package java_cup.runtime;
002:
003:        /**
004:         * Defines the Symbol class, which is used to represent all terminals
005:         * and nonterminals while parsing.  The lexer should pass CUP Symbols 
006:         * and CUP returns a Symbol.
007:         *
008:         * @version last updated: 7/3/96
009:         * @author  Frank Flannery
010:         */
011:
012:        /* ****************************************************************
013:         Class Symbol
014:         what the parser expects to receive from the lexer. 
015:         the token is identified as follows:
016:         sym:    the symbol type
017:         parse_state: the parse state.
018:         value:  is the lexical value of type Object
019:         left :  is the left position in the original input file
020:         right:  is the right position in the original input file
021:         ******************************************************************/
022:
023:        public class Symbol {
024:
025:            /*******************************
026:             Constructor for l,r values
027:             *******************************/
028:
029:            public Symbol(int id, int l, int r, Object o) {
030:                this (id);
031:                left = l;
032:                right = r;
033:                value = o;
034:            }
035:
036:            /*******************************
037:             Constructor for no l,r values
038:             ********************************/
039:
040:            public Symbol(int id, Object o) {
041:                this (id);
042:                left = -1;
043:                right = -1;
044:                value = o;
045:            }
046:
047:            /*****************************
048:             Constructor for no value
049:             ***************************/
050:
051:            public Symbol(int sym_num, int l, int r) {
052:                sym = sym_num;
053:                left = l;
054:                right = r;
055:                value = null;
056:            }
057:
058:            /***********************************
059:             Constructor for no value or l,r
060:             ***********************************/
061:
062:            public Symbol(int sym_num) {
063:                this (sym_num, -1);
064:                left = -1;
065:                right = -1;
066:                value = null;
067:            }
068:
069:            /***********************************
070:             Constructor to give a start state
071:             ***********************************/
072:            public Symbol(int sym_num, int state) {
073:                sym = sym_num;
074:                parse_state = state;
075:            }
076:
077:            /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
078:
079:            /** The symbol number of the terminal or non terminal being represented */
080:            public int sym;
081:
082:            /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
083:
084:            /** The parse state to be recorded on the parse stack with this symbol.
085:             *  This field is for the convenience of the parser and shouldn't be 
086:             *  modified except by the parser. 
087:             */
088:            public int parse_state;
089:            /** This allows us to catch some errors caused by scanners recycling
090:             *  symbols.  For the use of the parser only. [CSA, 23-Jul-1999] */
091:            boolean used_by_parser = false;
092:
093:            /*******************************
094:             The data passed to parser
095:             *******************************/
096:
097:            public int left, right;
098:            public Object value;
099:
100:            /*****************************
101:              Printing this token out. (Override for pretty-print).
102:             ****************************/
103:            public String toString() {
104:                return "#" + sym;
105:            }
106:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.