Top Description Inners Fields Constructors Methods
org.apache.avro.io.parsing

public abstract Class Symbol

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.avro.io.parsing.Symbol.Terminal, org.apache.avro.io.parsing.Symbol.ImplicitAction, org.apache.avro.io.parsing.Symbol.Root, org.apache.avro.io.parsing.Symbol.Sequence, org.apache.avro.io.parsing.Symbol.Repeater, org.apache.avro.io.parsing.Symbol.Alternative, org.apache.avro.io.parsing.Symbol.IntCheckAction
Imports
java.util.ArrayList, .HashMap, .HashSet, .Iterator, .List, .Map, .NoSuchElementException, .Set, org.apache.avro.Schema

Symbol is the base of all symbols (terminals and non-terminals) of the grammar.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
public static class
private static class
public static class
public static class
public static enum
public static class
public static class
protected static class
protected static class
public static class
private static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public final Symbol.Kind
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
NULL

The terminal symbols for the grammar.

public final Symbol[]
production

The production for this symbol.

public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol
public static final Symbol

Constructor Summary

AccessConstructor and Description
protected
Symbol(Symbol.Kind kind)

Constructs a new symbol of the given kind kind.

protected
Symbol(Symbol.Kind kind, Symbol[] production)

Method Summary

Modifier and TypeMethod and Description
pack-priv static Symbol
alt(Symbol[] symbols, String[] labels)

A convenience method to construct a union.

private static void
copyFixups(List<Symbol.Fixup> fixups, Symbol[] out, int outPos, Symbol[] toCopy)

public static Symbol.DefaultStartAction
defaultStartAction(byte[] contents)

public static Symbol.EnumAdjustAction
enumAdjustAction(int rsymCount, Object[] adj)

public static Symbol.EnumLabelsAction
enumLabelsAction(List<String> symbols)

For JSON.

pack-priv static Symbol
error(String e)

A convenience method to construct an ErrorAction.

public static Symbol.FieldAdjustAction
fieldAdjustAction(int rindex, String fname, Set<String> aliases)

public static Symbol.FieldOrderAction
public Symbol
pack-priv static void
flatten(Symbol[]
The array of input symbols to flatten
in
,
int
The position where the input sub-array starts.
start
,
Symbol[]
The output that receives the flattened list of symbols. The output array should have sufficient space to receive the expanded sub-array of symbols.
out
,
int
The position where the output input sub-array starts.
skip
,
Map<Symbol.Sequence, Symbol.Sequence>
A map of symbols which have already been expanded. Useful for handling recursive definitions and for caching.
map
,
Map<Symbol.Sequence, List<Symbol.Fixup>>
A map to to store the list of fix-ups.
map2
)

Flattens the given sub-array of symbols into an sub-array of symbols.

public int
protected static int

Returns:

The number of symbols that will be produced if one expands the given input.
flattenedSize
(Symbol[]
The array of input symbols.
symbols
,
int
The index where the subarray starts.
start
)

Returns the amount of space required to flatten the given sub-array of symbols.

public static boolean
hasErrors(Symbol symbol)

Returns true if the Parser contains any Error symbol, indicating that it may fail for some inputs.

private static boolean
hasErrors(Symbol symbol, Set<Symbol> visited)

private static boolean
hasErrors(Symbol root, Symbol[] symbols, Set<Symbol> visited)

public static Symbol.IntCheckAction
intCheckAction(int size)

pack-priv static Symbol
repeat(Symbol endSymbol, Symbol...
The symbols to repeat in the repeater.
symsToRepeat
)

A convenience method to construct a repeater.

pack-priv static Symbol
resolve(Symbol
The writer symbol
w
,
Symbol
The reader symbol
r
)

A convenience method to construct a ResolvingAction.

pack-priv static Symbol
root(Symbol... symbols)

A convenience method to construct a root symbol.

pack-priv static Symbol
seq(Symbol...
The constituent symbols of the sequence.
production
)

A convenience method to construct a sequence.

public static Symbol.SkipAction
skipAction(Symbol symToSkip)

public static Symbol.UnionAdjustAction
unionAdjustAction(int rindex, Symbol sym)

public static Symbol.WriterUnionAction
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait