001: /*
002: * xtc - The eXTensible Compiler
003: * Copyright (C) 2004-2007 Robert Grimm
004: *
005: * This program is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU General Public License
007: * version 2 as published by the Free Software Foundation.
008: *
009: * This program is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: *
014: * You should have received a copy of the GNU General Public License
015: * along with this program; if not, write to the Free Software
016: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
017: * USA.
018: */
019: package xtc;
020:
021: import xtc.tree.Attribute;
022:
023: /**
024: * Global constants.
025: *
026: * @author Robert Grimm
027: * @version $Revision: 1.114 $
028: */
029: public interface Constants {
030:
031: /** Flag for whether to print debugging information. */
032: public static final boolean DEBUG = false;
033:
034: /** The major version number. */
035: public static final int MAJOR = 1;
036:
037: /** The minor version number. */
038: public static final int MINOR = 13;
039:
040: /** The revision number. */
041: public static final int REVISION = 2;
042:
043: /** The complete version as a string. */
044: public static final String VERSION = MAJOR + "." + MINOR + "."
045: + REVISION;
046:
047: /** The copyright notice for <em>Rats!</em>. */
048: public static final String COPY = "(C) 2004-2007 Robert Grimm";
049:
050: /** The copyright notice for all of xtc. */
051: public static final String FULL_COPY = "(C) 2004-2007 Robert Grimm and New York University";
052:
053: /**
054: * The start index for lines. Note that the same constant is also
055: * defined as {@link xtc.parser.ParserBase#FIRST_LINE} to avoid
056: * parsers depending on this class.
057: */
058: public static final int FIRST_LINE = 1;
059:
060: /**
061: * The start index for columns. Note that the same constant is also
062: * defined as {@link xtc.parser.ParserBase#FIRST_COLUMN} to avoid
063: * parsers depending on this class.
064: */
065: public static final int FIRST_COLUMN = 1;
066:
067: /** The number of spaces per indentation when pretty printing sources. */
068: public static final int INDENTATION = 2;
069:
070: /** The number of characters per line when pretty printing sources. */
071: public static final int LINE_LENGTH = 78;
072:
073: /** The line separator for the current platform. */
074: public static final String LINE_SEPARATOR = System
075: .getProperty("line.separator");
076:
077: /** The qualification character. */
078: public static final char QUALIFIER = '.';
079:
080: /** The start character for opaque substrings in qualified strings. */
081: public static final char START_OPAQUE = '(';
082:
083: /** The end character for opaque substrings in qualified strings. */
084: public static final char END_OPAQUE = ')';
085:
086: // =========================================================================
087:
088: /** A fuzzy boolean. */
089: public static enum FuzzyBoolean {
090: /** True. */
091: TRUE,
092: /** Not true. */
093: FALSE,
094: /** Indeterminate. */
095: MAYBE
096: };
097:
098: // =========================================================================
099:
100: /**
101: * The property name for unmodified nodes. The value must be the
102: * unmodified {@link xtc.tree.Node node} before any transformations.
103: */
104: public static final String ORIGINAL = "xtc.Constants.Original";
105:
106: /**
107: * The property name for synthetic nodes. The value must be
108: * a <code>Boolean</code>.
109: */
110: public static final String SYNTHETIC = "xtc.Constants.Synthetic";
111:
112: /**
113: * The property name for scopes. The value must be a qualified scope
114: * name.
115: */
116: public static final String SCOPE = "xtc.Constants.Scope";
117:
118: /**
119: * The property name for types. The value must be a {@link
120: * xtc.type.Type type}.
121: */
122: public static final String TYPE = "xtc.Constants.Type";
123:
124: /**
125: * The property name for a modified node's arguments. The value
126: * depends on the applied transformation.
127: */
128: public static final String ARGUMENTS = "xtc.Constants.Arguments";
129:
130: // =========================================================================
131:
132: /**
133: * The extension (without the separating dot) for files containing
134: * grammar modules.
135: */
136: public static final String EXT_GRAMMAR = "rats";
137:
138: // =========================================================================
139:
140: /** The attribute name of all factory attributes. */
141: public static final String NAME_FACTORY = "factory";
142:
143: /** The attribute name of all flag attributes. */
144: public static final String NAME_FLAG = "flag";
145:
146: /** The attribute name of all gcc attributes. */
147: public static final String NAME_GCC = "gcc";
148:
149: /** The attribute name of all main attributes. */
150: public static final String NAME_MAIN = "main";
151:
152: /** The attribute name of all parser attributes. */
153: public static final String NAME_PARSER = "parser";
154:
155: /** The attribute name of all printer attributes. */
156: public static final String NAME_PRINTER = "printer";
157:
158: /** The attribute name of all string set attributes. */
159: public static final String NAME_STRING_SET = "setOfString";
160:
161: // =========================================================================
162:
163: /** The attribute name of all storage class attributes. */
164: public static final String NAME_STORAGE = "storage";
165:
166: /** The <code>auto</code> storage class attribute. */
167: public static final Attribute ATT_STORAGE_AUTO = new Attribute(
168: NAME_STORAGE, "auto");
169:
170: /** The <code>extern</code> storage class attribute. */
171: public static final Attribute ATT_STORAGE_EXTERN = new Attribute(
172: NAME_STORAGE, "extern");
173:
174: /** The <code>register</code> storage class attribute. */
175: public static final Attribute ATT_STORAGE_REGISTER = new Attribute(
176: NAME_STORAGE, "register");
177:
178: /** The <code>static</code> storage class attribute. */
179: public static final Attribute ATT_STORAGE_STATIC = new Attribute(
180: NAME_STORAGE, "static");
181:
182: /** The <code>typdef</code> storage class attribute. */
183: public static final Attribute ATT_STORAGE_TYPEDEF = new Attribute(
184: NAME_STORAGE, "typedef");
185:
186: // =========================================================================
187:
188: /** The attribute name of all function style declaration attributes. */
189: public static final String NAME_STYLE = "style";
190:
191: /** The old style attribute. */
192: public static final Attribute ATT_STYLE_OLD = new Attribute(
193: NAME_STYLE, "old");
194:
195: /** The new style attribute. */
196: public static final Attribute ATT_STYLE_NEW = new Attribute(
197: NAME_STYLE, "new");
198:
199: // =========================================================================
200:
201: /** The attribute name of all visibility attributes. */
202: public static final String NAME_VISIBILITY = "visibility";
203:
204: /** The public visibility attribute. */
205: public static final Attribute ATT_PUBLIC = new Attribute(
206: NAME_VISIBILITY, "public");
207:
208: /** The protected visibility attribute. */
209: public static final Attribute ATT_PROTECTED = new Attribute(
210: NAME_VISIBILITY, "protected");
211:
212: /** The package private visibility attribute. */
213: public static final Attribute ATT_PACKAGE_PRIVATE = new Attribute(
214: NAME_VISIBILITY, "packagePrivate");
215:
216: /** The private visibility attribute. */
217: public static final Attribute ATT_PRIVATE = new Attribute(
218: NAME_VISIBILITY, "private");
219:
220: // =========================================================================
221:
222: /** The canonical <code>abstract</code> attribute. */
223: public static final Attribute ATT_ABSTRACT = new Attribute(
224: "abstract");
225:
226: /** The canonical <code>builtin</code> attribute. */
227: public static final Attribute ATT_BUILTIN = new Attribute("builtin");
228:
229: /** The canonical <code>constant</code> attribute. */
230: public static final Attribute ATT_CONSTANT = new Attribute(
231: "constant");
232:
233: /** The canonical <code>defined</code> attribute. */
234: public static final Attribute ATT_DEFINED = new Attribute("defined");
235:
236: /** The canonical <code>dump</code> attribute. */
237: public static final Attribute ATT_DUMP = new Attribute("dump");
238:
239: /** The canonical <code>flatten</code> attribute. */
240: public static final Attribute ATT_FLATTEN = new Attribute("flatten");
241:
242: /** The canonical <code>generic</code> attribute. */
243: public static final Attribute ATT_GENERIC = new Attribute("generic");
244:
245: /** The canonical <code>genericAsVoid</code> attribute. */
246: public static final Attribute ATT_GENERIC_AS_VOID = new Attribute(
247: "genericAsVoid");
248:
249: /** The canonical <code>ignoringCase</code> attribute. */
250: public static final Attribute ATT_IGNORING_CASE = new Attribute(
251: "ignoringCase");
252:
253: /** The canonical <code>implicit</code> attribute. */
254: public static final Attribute ATT_IMPLICIT = new Attribute(
255: "implicit");
256:
257: /** The canonical <code>inline</code> attribute. */
258: public static final Attribute ATT_INLINE = new Attribute("inline");
259:
260: /** The canonical <code>loop</code> attribute. */
261: public static final Attribute ATT_LOOP = new Attribute("loop");
262:
263: /** The canonical <code>lvalue</code> attribute. */
264: public static final Attribute ATT_LVALUE = new Attribute("lvalue");
265:
266: /** The canonical <code>macro</code> attribute. */
267: public static final Attribute ATT_MACRO = new Attribute("macro");
268:
269: /** The canonical <code>memoized</code> attribute. */
270: public static final Attribute ATT_MEMOIZED = new Attribute(
271: "memoized");
272:
273: /** The canonical <code>native</code> attribute. */
274: public static final Attribute ATT_NATIVE = new Attribute("native");
275:
276: /** The canonical <code>node</code> attribute. */
277: public static final Attribute ATT_NODE = new Attribute("node");
278:
279: /** The canonical <code>notAValue</code> attribute. */
280: public static final Attribute ATT_NOT_A_VALUE = new Attribute(
281: "notAValue");
282:
283: /** The canonical <code>noinline</code> attribute. */
284: public static final Attribute ATT_NO_INLINE = new Attribute(
285: "noinline");
286:
287: /** The canonical <code>nowarn</code> attribute. */
288: public static final Attribute ATT_NO_WARNINGS = new Attribute(
289: "nowarn");
290:
291: /** The canonical <code>optional</code> attribute. */
292: public static final Attribute ATT_OPTIONAL = new Attribute(
293: "optional");
294:
295: /** The canonical <code>withParseTree</code> attribute. */
296: public static final Attribute ATT_PARSE_TREE = new Attribute(
297: "withParseTree");
298:
299: /** The canonical <code>profile</code> attribute. */
300: public static final Attribute ATT_PROFILE = new Attribute("profile");
301:
302: /** The canonical <code>rawTypes</code> attribute. */
303: public static final Attribute ATT_RAW_TYPES = new Attribute(
304: "rawTypes");
305:
306: /** The canonical <code>resetting</code> attribute. */
307: public static final Attribute ATT_RESETTING = new Attribute(
308: "resetting");
309:
310: /** The canonical <code>restrict</code> attribute. */
311: public static final Attribute ATT_RESTRICT = new Attribute(
312: "restrict");
313:
314: /** The canonical <code>stateful</code> attribute. */
315: public static final Attribute ATT_STATEFUL = new Attribute(
316: "stateful");
317:
318: /** The canonical <code>strictfp</code> attribute. */
319: public static final Attribute ATT_STRICT_FP = new Attribute(
320: "strictfp");
321:
322: /** The canonical <code>synchronized</code> attribute. */
323: public static final Attribute ATT_SYNCHRONIZED = new Attribute(
324: "synchronized");
325:
326: /** The canonical <code>transient</code> attribute. */
327: public static final Attribute ATT_TRANSIENT = new Attribute(
328: "transient");
329:
330: /** The canonical <code>uninitialized</code> attribute. */
331: public static final Attribute ATT_UNINITIALIZED = new Attribute(
332: "uninitialized");
333:
334: /** The canonical <code>used</code> attribute. */
335: public static final Attribute ATT_USED = new Attribute("used");
336:
337: /** The canonical <code>variable</code> attribute. */
338: public static final Attribute ATT_VARIABLE = new Attribute(
339: "variable");
340:
341: /** The canonical <code>variant</code> attribute. */
342: public static final Attribute ATT_VARIANT = new Attribute("variant");
343:
344: /** The canonical <code>verbose</code> attribute. */
345: public static final Attribute ATT_VERBOSE = new Attribute("verbose");
346:
347: /** The canonical <code>volatile</code> attribute. */
348: public static final Attribute ATT_VOLATILE = new Attribute(
349: "volatile");
350:
351: /** The canonical <code>withLocation</code> attribute. */
352: public static final Attribute ATT_WITH_LOCATION = new Attribute(
353: "withLocation");
354:
355: }
|