Tabnine Logo
MismatchedCharException
Code IndexAdd Tabnine to your IDE (free)

How to use
MismatchedCharException
in
antlr

Best Java code snippets using antlr.MismatchedCharException (Showing top 10 results out of 315)

origin: org.glassfish.external/antlr

public void match(String s) throws MismatchedCharException, CharStreamException {
  int len = s.length();
  for (int i = 0; i < len; i++) {
    if (LA(1) != s.charAt(i)) {
      throw new MismatchedCharException(LA(1), s.charAt(i), false, this);
    }
    consume();
  }
}
origin: org.glassfish.external/antlr

  sb.append("expecting ");   appendCharName(sb, expecting);
  sb.append(", found ");     appendCharName(sb, foundChar);
  break;
case NOT_CHAR:
  sb.append("expecting anything but '");
  appendCharName(sb, expecting);
  sb.append("'; got it anyway");
  break;
    sb.append("NOT ");
  sb.append("in range: ");
  appendCharName(sb, expecting);
  sb.append("..");
  appendCharName(sb, upper);
  sb.append(", found ");
  appendCharName(sb, foundChar);
  break;
case SET:
  int[] elems = set.toArray();
  for (int i = 0; i < elems.length; i++) {
    appendCharName(sb, elems[i]);
  appendCharName(sb, foundChar);
  break;
default :
origin: org.glassfish.main.persistence.cmp/cmp-support-ejb

if (mismatched.mismatchType == MismatchedCharException.CHAR) {
  if (mismatched.foundChar == EOF_CHAR) {
    ErrorMsg.error(mismatched.getLine(), mismatched.getColumn(),
    ErrorMsg.error(mismatched.getLine(), mismatched.getColumn(), 
      I18NHelper.getMessage(msgs, "EXC_ExpectedCharFound", //NOI18N
        String.valueOf((char)mismatched.expecting), 
origin: org.glassfish.external/antlr

public void match(char c) throws MismatchedCharException, CharStreamException {
  if (LA(1) != c) {
    throw new MismatchedCharException(LA(1), c, false, this);
  }
  consume();
}
origin: org.glassfish.external/antlr

public void matchNot(char c) throws MismatchedCharException, CharStreamException {
  if (LA(1) == c) {
    throw new MismatchedCharException(LA(1), c, true, this);
  }
  consume();
}
origin: org.glassfish.external/antlr

public void match(BitSet b) throws MismatchedCharException, CharStreamException {
  if (!b.member(LA(1))) {
    throw new MismatchedCharException(LA(1), b, false, this);
  }
  else {
    consume();
  }
}
origin: org.glassfish.external/antlr

public void matchRange(char c1, char c2) throws MismatchedCharException, CharStreamException {
  if (LA(1) < c1 || LA(1) > c2) throw new MismatchedCharException(LA(1), c1, c2, false, this);
  consume();
}
origin: org.codehaus.groovy/groovy-jdk14

protected final void mSTRING_NL(boolean _createToken,
  boolean allowNewline
) throws RecognitionException, CharStreamException, TokenStreamException {
  int _ttype; Token _token=null; int _begin=text.length();
  _ttype = STRING_NL;
  int _saveIndex;
  
  if ( inputState.guessing==0 ) {
    if (!allowNewline) throw new MismatchedCharException('\n', '\n', true, this);
  }
  mONE_NL(false,false);
  if ( inputState.guessing==0 ) {
    text.setLength(_begin); text.append('\n');
  }
  if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
    _token = makeToken(_ttype);
    _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  }
  _returnToken = _token;
}

origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

protected final void mSTRING_NL(boolean _createToken,
  boolean allowNewline
) throws RecognitionException, CharStreamException, TokenStreamException {
  int _ttype; Token _token=null; int _begin=text.length();
  _ttype = STRING_NL;
  int _saveIndex;
  
  if ( inputState.guessing==0 ) {
    if (!allowNewline) throw new MismatchedCharException('\n', '\n', true, this);
  }
  mONE_NL(false,false);
  if ( inputState.guessing==0 ) {
    text.setLength(_begin); text.append('\n');
  }
  if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
    _token = makeToken(_ttype);
    _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  }
  _returnToken = _token;
}

origin: org.kohsuke.droovy/groovy

protected final void mSTRING_NL(boolean _createToken,
  boolean allowNewline
) throws RecognitionException, CharStreamException, TokenStreamException {
  int _ttype; Token _token=null; int _begin=text.length();
  _ttype = STRING_NL;
  int _saveIndex;
  
  if ( inputState.guessing==0 ) {
    if (!allowNewline) throw new MismatchedCharException('\n', '\n', true, this);
  }
  mONE_NL(false,false);
  if ( inputState.guessing==0 ) {
    text.setLength(_begin); text.append('\n');
  }
  if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
    _token = makeToken(_ttype);
    _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
  }
  _returnToken = _token;
}

antlrMismatchedCharException

Most used methods

  • <init>
  • appendCharName
    Append a char to the msg buffer. If special, then show escaped version
  • getColumn
  • getLine

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now