01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * Portions Copyrighted 2007 Sun Microsystems, Inc.
16: */
17: package org.netbeans.modules.languages;
18:
19: import org.netbeans.modules.languages.parser.Parser;
20: import org.netbeans.modules.languages.parser.Pattern;
21:
22: /**
23: *
24: * @author hanz
25: */
26: public class TokenType {
27:
28: private String startState;
29: private Pattern pattern;
30: private String type;
31: private int typeID;
32: private String endState;
33: private int priority;
34: private Feature properties;
35:
36: public TokenType(String startState, Pattern pattern, String type,
37: int typeID, String endState, int priority,
38: Feature properties) {
39: this .startState = startState == null ? Parser.DEFAULT_STATE
40: : startState;
41: this .pattern = pattern;
42: this .type = type;
43: this .typeID = typeID;
44: this .endState = endState == null ? Parser.DEFAULT_STATE
45: : endState;
46: this .priority = priority;
47: this .properties = properties;
48: }
49:
50: public String getType() {
51: return type;
52: }
53:
54: public int getTypeID() {
55: return typeID;
56: }
57:
58: public String getStartState() {
59: return startState;
60: }
61:
62: public String getEndState() {
63: return endState;
64: }
65:
66: public Pattern getPattern() {
67: return pattern;
68: }
69:
70: public int getPriority() {
71: return priority;
72: }
73:
74: public Feature getProperties() {
75: return properties;
76: }
77:
78: public String toString() {
79: return "Rule " + startState + " : type " + type + " : "
80: + endState;
81: }
82: }
|