Added javadocs for recently added methods
This commit is contained in:
parent
6c23a96046
commit
90c234895a
|
@ -976,6 +976,17 @@ public class ParserATNSimulator extends ATNSimulator {
|
|||
return reach;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a configuration set containing only the configurations from
|
||||
* {@code configs} which are in a {@link RuleStopState}. If all
|
||||
* configurations in {@code configs} are already in a rule stop state, this
|
||||
* method simply returns {@code configs}.
|
||||
*
|
||||
* @param configs the configuration set to update
|
||||
* @return {@code configs} if all configurations in {@code configs} are in a
|
||||
* rule stop state, otherwise return a new configuration set containing only
|
||||
* the configurations from {@code configs} which are in a rule stop state
|
||||
*/
|
||||
protected ATNConfigSet removeNonRuleStopStates(ATNConfigSet configs) {
|
||||
if (PredictionMode.onlyRuleStopStates(configs)) {
|
||||
return configs;
|
||||
|
|
|
@ -212,6 +212,16 @@ public enum PredictionMode {
|
|||
return heuristic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if any configuration in {@code configs} is in a
|
||||
* {@link RuleStopState}. Configurations meeting this condition have reached
|
||||
* the end of the decision rule (local context) or end of start rule (full
|
||||
* context).
|
||||
*
|
||||
* @param configs the configuration set to test
|
||||
* @return {@code true} if any configuration in {@code configs} is in a
|
||||
* {@link RuleStopState}, otherwise {@code false}
|
||||
*/
|
||||
public static boolean hasConfigAtRuleStopState(ATNConfigSet configs) {
|
||||
for (ATNConfig c : configs) {
|
||||
if (c.state instanceof RuleStopState) {
|
||||
|
@ -222,6 +232,16 @@ public enum PredictionMode {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if all configurations in {@code configs} are in a
|
||||
* {@link RuleStopState}. Configurations meeting this condition have reached
|
||||
* the end of the decision rule (local context) or end of start rule (full
|
||||
* context).
|
||||
*
|
||||
* @param configs the configuration set to test
|
||||
* @return {@code true} if all configurations in {@code configs} are in a
|
||||
* {@link RuleStopState}, otherwise {@code false}
|
||||
*/
|
||||
public static boolean onlyRuleStopStates(@NotNull ATNConfigSet configs) {
|
||||
for (ATNConfig config : configs) {
|
||||
if (!(config.state instanceof RuleStopState)) {
|
||||
|
|
Loading…
Reference in New Issue