public SetTransition(ATNState target, IntervalSet set) { super(target); if ( set == null ) set = IntervalSet.of(Token.INVALID_TYPE); this.set = set; }
@Override public IntervalSet label() { return IntervalSet.of(from, to); }
@Override public IntervalSet label() { return IntervalSet.of(label); }
public IntervalSet complement(int minElement, int maxElement) { return this.complement(IntervalSet.of(minElement,maxElement)); }
/** * If {@code codePoint} is <= U+FFFF, returns a new {@link AtomTransition}. * Otherwise, returns a new {@link SetTransition}. */ public static Transition createWithCodePoint(ATNState target, int codePoint) { if (Character.isSupplementaryCodePoint(codePoint)) { return new SetTransition(target, IntervalSet.of(codePoint)); } else { return new AtomTransition(target, codePoint); } }
/** * If {@code codePointFrom} and {@code codePointTo} are both * <= U+FFFF, returns a new {@link RangeTransition}. * Otherwise, returns a new {@link SetTransition}. */ public static Transition createWithCodePointRange( ATNState target, int codePointFrom, int codePointTo) { if (Character.isSupplementaryCodePoint(codePointFrom) || Character.isSupplementaryCodePoint(codePointTo)) { return new SetTransition(target, IntervalSet.of(codePointFrom, codePointTo)); } else { return new RangeTransition(target, codePointFrom, codePointTo); } } }
public SetTransition(ATNState target, IntervalSet set) { super(target); if ( set == null ) set = IntervalSet.of(Token.INVALID_TYPE); this.set = set; }
public SetTransition(ATNState target, IntervalSet set) { super(target); if ( set == null ) set = IntervalSet.of(Token.INVALID_TYPE); this.set = set; }
/** Return min to max char as defined by the target. * If no target, use max unicode char value. */ public IntSet getAllCharValues() { return IntervalSet.of(Lexer.MIN_CHAR_VALUE, getMaxCharValue()); }
/** Return min to max char as defined by the target. * If no target, use max unicode char value. */ public IntSet getAllCharValues() { return IntervalSet.of(Lexer.MIN_CHAR_VALUE, getMaxCharValue()); }
/** Return min to max char as defined by the target. * If no target, use max unicode char value. */ public IntSet getAllCharValues() { return IntervalSet.of(Lexer.MIN_CHAR_VALUE, getMaxCharValue()); }
/** Return min to max char as defined by the target. * If no target, use max unicode char value. */ public IntSet getAllCharValues() { return IntervalSet.of(Lexer.MIN_CHAR_VALUE, getMaxCharValue()); }
/** Return min to max char as defined by the target. * If no target, use max unicode char value. */ public IntSet getAllCharValues() { return IntervalSet.of(Lexer.MIN_CHAR_VALUE, getMaxCharValue()); }
public SetTransition(@NotNull ATNState target, @Nullable IntervalSet set) { super(target); if ( set == null ) set = IntervalSet.of(Token.INVALID_TYPE); this.set = set; }
/** * If {@code codePoint} is <= U+FFFF, returns a new {@link AtomTransition}. * Otherwise, returns a new {@link SetTransition}. */ public static Transition createWithCodePoint(ATNState target, int codePoint) { if (Character.isSupplementaryCodePoint(codePoint)) { return new SetTransition(target, IntervalSet.of(codePoint)); } else { return new AtomTransition(target, codePoint); } }
/** Return a set of all possible token or char types for this grammar */ public IntSet getTokenTypes() { if ( isLexer() ) { return getAllCharValues(); } return IntervalSet.of(Token.MIN_USER_TOKEN_TYPE, getMaxTokenType()); }
/** Return a set of all possible token or char types for this grammar */ public IntSet getTokenTypes() { if ( isLexer() ) { return getAllCharValues(); } return IntervalSet.of(Token.MIN_USER_TOKEN_TYPE, getMaxTokenType()); }
/** Return a set of all possible token or char types for this grammar */ public IntSet getTokenTypes() { if ( isLexer() ) { return getAllCharValues(); } return IntervalSet.of(Token.MIN_USER_TOKEN_TYPE, getMaxTokenType()); }