public class AffineGrammar extends Object implements Grammar<AffineGrammar.Nonterminal>
Modifier and Type | Class and Description |
---|---|
static class |
AffineGrammar.Nonterminal
These are the nonterminal symbols for the affine grammar.
|
Constructor and Description |
---|
AffineGrammar()
Creates an instance of the affine grammar.
|
AffineGrammar(int minMiddleSkips)
Creates an instance of the affine grammar.
|
Modifier and Type | Method and Description |
---|---|
AffineGrammar.Nonterminal[] |
dependencySort()
Returns the nonterminals of this grammar sorted according to their
dependencies on one another.
|
EnumSet<AffineGrammar.Nonterminal> |
getAccepting()
Returns the set of all accepting nonterminals of this grammar.
|
AffineGrammar.Nonterminal |
getAxiom()
Returns the axiom of this grammar.
|
Class<AffineGrammar.Nonterminal> |
getNonterminalClass()
Returns the enum class that lists the nonterminal symbols of
this grammar.
|
LinkedList<ProductionRule<AffineGrammar.Nonterminal>> |
getPossibleRules(AffineGrammar.Nonterminal nonterminal,
int leftSize,
int rightSize,
int M,
int N)
Returns all production rules of this grammar that can be applied
in the current situation.
|
boolean |
requires(OperationType type)
This method should return true if and only if this Grammar uses the given OperationType.
|
public AffineGrammar()
public AffineGrammar(int minMiddleSkips)
minMiddleSkips
- the minimum number of skip operations that are
required
for a skip-region in the middle to be permitted.public AffineGrammar.Nonterminal[] dependencySort()
Grammar
dependencySort
in interface Grammar<AffineGrammar.Nonterminal>
public LinkedList<ProductionRule<AffineGrammar.Nonterminal>> getPossibleRules(@NonNull AffineGrammar.Nonterminal nonterminal, int leftSize, int rightSize, int M, int N)
Grammar
getPossibleRules
in interface Grammar<AffineGrammar.Nonterminal>
nonterminal
- the nonterminal symbol on the left side of all
returned production rules.leftSize
- the nodes available in the left input sequence.rightSize
- the nodes available in the right right sequence.M
- the overall length of the left input sequence.N
- the overall length of the right input sequence.public Class<AffineGrammar.Nonterminal> getNonterminalClass()
Grammar
getNonterminalClass
in interface Grammar<AffineGrammar.Nonterminal>
public AffineGrammar.Nonterminal getAxiom()
Grammar
getAxiom
in interface Grammar<AffineGrammar.Nonterminal>
public EnumSet<AffineGrammar.Nonterminal> getAccepting()
Grammar
getAccepting
in interface Grammar<AffineGrammar.Nonterminal>
public boolean requires(@NonNull OperationType type)
Grammar
requires
in interface Grammar<AffineGrammar.Nonterminal>
type
- an OperationType.Copyright (C) 2016 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/