Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7b6440409f328d95ce02b808736e1506edcf7af4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package org.eclipse.photran.internal.core.f95modelparser;


/**
 * Enumerates the terminal symbols in the grammar being parsed
 */
public class Token implements ParserSymbol, IPresentationBlock
{
    /**
     * The Terminal that this token is an instance of
     */
    private Terminal terminal;

    /**
     * Returns the Terminal that this token is an instance of
     */
    public Terminal getTerminal() { return terminal; }

    /**
     * Sets the Terminal that this token is an instance of
     */
    public void setTerminal(Terminal value) { terminal = value; }

    /**
     * The filename in which the token occurred
     */
    private String filename;

    /**
     * Returns the filename in which the token occurred
     */
    public String getFilename() { return filename; }

    /**
     * Sets the filename in which the token occurred
     */
    public void setFilename(String value) { filename = value; }

    /**
     * The line number on which the token starts (1=first line, 2=second, etc.)
     */
    private int startLine;

    /**
     * Returns the line number on which the token starts (1=first line, 2=second, etc.)
     */
    public int getStartLine() { return startLine; }

    /**
     * Sets the line number on which the token starts (1=first line, 2=second, etc.)
     */
    public void setStartLine(int value) { startLine = value; }

    /**
     * The column number on which the token starts (1=first column, 2=second, etc.)
     */
    private int startCol;

    /**
     * Returns the column number on which the token starts (1=first column, 2=second, etc.)
     */
    public int getStartCol() { return startCol; }

    /**
     * Sets the column number on which the token starts (1=first column, 2=second, etc.)
     */
    public void setStartCol(int value) { startCol = value; }

    /**
     * The line number on which the token ends (1=first line, 2=second, etc.)
     */
    private int endLine;

    /**
     * Returns the line number on which the token ends (1=first line, 2=second, etc.)
     */
    public int getEndLine() { return endLine; }

    /**
     * Sets the line number on which the token ends (1=first line, 2=second, etc.)
     */
    public void setEndLine(int value) { endLine = value; }

    /**
     * The column number on which the token ends (1=first column, 2=second, etc.)
     */
    private int endCol;

    /**
     * Returns the column number on which the token ends (1=first column, 2=second, etc.)
     */
    public int getEndCol() { return endCol; }

    /**
     * Sets the column number on which the token ends (1=first column, 2=second, etc.)
     */
    public void setEndCol(int value) { endCol = value; }

    /**
     * The start of the token, as a character offset in the file
     * 0=first character, 1=second, etc.
     */
    private int offset;

    /**
     * Returns the start of the token, as a character offset in the file
     * 0=first character, 1=second, etc.
     */
    public int getOffset() { return offset; }

    /**
     * Sets the start of the token, as a character offset in the file
     * 0=first character, 1=second, etc.
     */
    public void setOffset(int value) { offset = value; }

    /**
     * The length of the token text, in characters
     */
    private int length;

    /**
     * Returns the length of the token text, in characters
     */
    public int getLength() { return length; }

    /**
     * Sets the length of the token text, in characters
     */
    public void setLength(int value) { length = value; }

    /**
     * The token text
     */
    private String text;

    /**
     * Returns the token text
     */
    public String getText() { return text; }

    /**
     * Sets the token text
     */
    public void setText(String value) { text = value; }

    /**
     * Returns a string describing the token
     */
    public String getDescription() { return terminal.getDescription() + ": \"" + text + "\""; }
    
    public String toString() { return getDescription(); }

    /**
     * See AbstractParseTreeNode
     */
	public void visitUsing(IPresentationBlockVisitor v)
	{
		v.visitToken(this);
	}
}

Back to the top