org.apache.avro.io.parsing
Class Symbol
java.lang.Object
org.apache.avro.io.parsing.Symbol
- Direct Known Subclasses:
- Symbol.Alternative, Symbol.DefaultStartAction, Symbol.ErrorAction, Symbol.FieldAdjustAction, Symbol.IntCheckAction, Symbol.Repeater, Symbol.ResolvingAction, Symbol.Root, Symbol.Sequence, Symbol.SkipAction, Symbol.UnionAdjustAction, Symbol.WriterUnionAction
public abstract class Symbol
- extends Object
Symbol is the base of all symbols (terminals and non-terminals) of
the grammar.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
kind
public final Symbol.Kind kind
production
public final Symbol[] production
- The production for this symbol. If this symbol is a terminal
this is null. Otherwise this holds the the sequence of
the symbols that forms the production for this symbol. The
sequence is in the reverse order of production. This is useful
for easy copying onto parsing stack.
Please note that this is a final. So the production for a symbol
should be known before that symbol is constructed. This requirement
cannot be met for those symbols which are recursive (e.g. a record that
holds union a branch of which is the record itself). To resolve this
problem, we initialize the symbol with an array of nulls. Later we
fill the symbols. Not clean, but works. The other option is to not have
this field a final. But keeping it final and thus keeping symbol immutable
gives some confort. See various generators how we generate records.
NULL
public static final Symbol NULL
- The terminal symbols for the grammar.
BOOLEAN
public static final Symbol BOOLEAN
INT
public static final Symbol INT
LONG
public static final Symbol LONG
FLOAT
public static final Symbol FLOAT
DOUBLE
public static final Symbol DOUBLE
STRING
public static final Symbol STRING
BYTES
public static final Symbol BYTES
FIXED
public static final Symbol FIXED
ENUM
public static final Symbol ENUM
UNION
public static final Symbol UNION
ARRAY_START
public static final Symbol ARRAY_START
ARRAY_END
public static final Symbol ARRAY_END
MAP_START
public static final Symbol MAP_START
MAP_END
public static final Symbol MAP_END
END
public static final Symbol END
ITEM_END
public static final Symbol ITEM_END
CONTINUE
public static final Symbol CONTINUE
FIELD_ACTION
public static final Symbol FIELD_ACTION
RECORD_START
public static final Symbol RECORD_START
RECORD_END
public static final Symbol RECORD_END
UNION_END
public static final Symbol UNION_END
DEFAULT_END_ACTION
public static final Symbol DEFAULT_END_ACTION
MAP_KEY_MARKER
public static final Symbol MAP_KEY_MARKER
Symbol
protected Symbol(Symbol.Kind kind)
- Constructs a new symbol of the given kind kind.
Symbol
protected Symbol(Symbol.Kind kind,
Symbol[] production)
Copyright © 2009 The Apache Software Foundation