01: package java_cup.runtime;
02:
03: /**
04: * Default Implementation for SymbolFactory, creates
05: * plain old Symbols
06: *
07: * @version last updated 27-03-2006
08: * @author Michael Petter
09: */
10:
11: /* *************************************************
12: class DefaultSymbolFactory
13:
14: interface for creating new symbols
15: ***************************************************/
16: public class DefaultSymbolFactory implements SymbolFactory {
17: // Factory methods
18: /**
19: * DefaultSymbolFactory for CUP.
20: * Users are strongly encoraged to use ComplexSymbolFactory instead, since
21: * it offers more detailed information about Symbols in source code.
22: * Yet since migrating has always been a critical process, You have the
23: * chance of still using the oldstyle Symbols.
24: *
25: * @deprecated as of CUP v11a
26: * replaced by the new java_cup.runtime.ComplexSymbolFactory
27: */
28: //@deprecated
29: public DefaultSymbolFactory() {
30: }
31:
32: public Symbol newSymbol(String name, int id, Symbol left,
33: Symbol right, Object value) {
34: return new Symbol(id, left, right, value);
35: }
36:
37: public Symbol newSymbol(String name, int id, Symbol left,
38: Symbol right) {
39: return new Symbol(id, left, right);
40: }
41:
42: public Symbol newSymbol(String name, int id, int left, int right,
43: Object value) {
44: return new Symbol(id, left, right, value);
45: }
46:
47: public Symbol newSymbol(String name, int id, int left, int right) {
48: return new Symbol(id, left, right);
49: }
50:
51: public Symbol startSymbol(String name, int id, int state) {
52: return new Symbol(id, state);
53: }
54:
55: public Symbol newSymbol(String name, int id) {
56: return new Symbol(id);
57: }
58:
59: public Symbol newSymbol(String name, int id, Object value) {
60: return new Symbol(id, value);
61: }
62: }
|