Package org.opencypher.tools.g4tree
Class InAlternative
- java.lang.Object
-
- org.opencypher.tools.g4tree.InAlternative
-
- All Implemented Interfaces:
GrammarItem
public class InAlternative extends Object
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opencypher.tools.g4tree.GrammarItem
GrammarItem.ItemType
-
-
Field Summary
-
Fields inherited from interface org.opencypher.tools.g4tree.GrammarItem
INDENT
-
-
Constructor Summary
Constructors Constructor Description InAlternative()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItem(GrammarItem grammarItem)List<GrammarItem>getChildren()get the child items as a list.StringgetContentStructure(String indent)protected GrammarItemgetItem(int index)StringgetStructure(String indent)Reserialise showing the internal structure of the grammar.GrammarItem.ItemTypegetType()what type, in terms of how to process its conversion to main grammarbooleanisKeywordPart()Could this be part or all of a keyword ? Is either a letter or all of its parts are lettersbooleanisPlural()are there more than one of these items.GrammarItemreachThrough()if this item is a wrapper round a single item, get that one.intsize()StringtoString()
-
-
-
Method Detail
-
getStructure
public String getStructure(String indent)
Description copied from interface:GrammarItemReserialise showing the internal structure of the grammar. This is based on the rules of the "orignal BNF" g4, and may not correspond to how the user thinks of the structure- Parameters:
indent- how much to indent each level of the structure- Returns:
- a String showing the internals and values in the grammar
-
getType
public GrammarItem.ItemType getType()
Description copied from interface:GrammarItemwhat type, in terms of how to process its conversion to main grammar- Returns:
-
getChildren
public List<GrammarItem> getChildren()
Description copied from interface:GrammarItemget the child items as a list. Terminals will return an empty list, non-lists will return a list of one.- Specified by:
getChildrenin interfaceGrammarItem- Returns:
-
size
public int size()
-
addItem
public void addItem(GrammarItem grammarItem)
-
getItem
protected GrammarItem getItem(int index)
-
isPlural
public boolean isPlural()
Description copied from interface:GrammarItemare there more than one of these items. Some serialisations will require brackets of some kind if there are- Specified by:
isPluralin interfaceGrammarItem- Returns:
- true if there are multiple of these items.
-
reachThrough
public GrammarItem reachThrough()
Description copied from interface:GrammarItemif this item is a wrapper round a single item, get that one. A wrapper may affect cardinality, optionality etc.- Specified by:
reachThroughin interfaceGrammarItem- Returns:
- the wrapped item, or this item itself it if isn't wrapper.
-
isKeywordPart
public boolean isKeywordPart()
Description copied from interface:GrammarItemCould this be part or all of a keyword ? Is either a letter or all of its parts are letters- Specified by:
isKeywordPartin interfaceGrammarItem- Returns:
- true iff this could be part of a keyword
-
-