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

How to use
ParseException
in
org.eclipse.datatools.sqltools.sql.parser

Best Java code snippets using org.eclipse.datatools.sqltools.sql.parser.ParseException (Showing top 5 results out of 315)

origin: org.eclipse/org.eclipse.datatools.sqltools.sql

private StringBuffer buildShortMessage(int maxSize)
{
  StringBuffer retval = new StringBuffer(Messages.ParseException_encountered); 
  Token tok = currentToken.next;
  for (int i = 0; i < maxSize; i++) 
  {
    if (i != 0)
    retval.append(" "); //$NON-NLS-1$
    if (tok.kind == 0) 
    {
      retval.append(tokenImage[0]);
      break;
    }
    retval.append(add_escapes(tok.image));
    tok = tok.next; 
  }
  //since the task/problem view already shows the line number, don't duplicate them in the description
  //retval
  //    .append(DmpMessages.getString("ParseException.atline")).append(currentToken.next.beginLine).append(DmpMessages.getString("ParseException.atcolumn")).append(currentToken.next.beginColumn); //$NON-NLS-1$ //$NON-NLS-2$
  retval.append(Messages.ParseException_period + eol); 
  return retval;
}
 
origin: org.eclipse/org.eclipse.datatools.sqltools.sql

/**
 * This method has the standard behavior when this object has been created using the standard constructors.
 * Otherwise, it uses "currentToken" and "expectedTokenSequences" to generate a parse error message and returns it.
 * If this object has been created due to a parse error, and you do not catch it (it gets thrown from the parser),
 * then this method is called during the printing of the final stack trace, and hence the correct error message gets
 * displayed.
 * @see #getShortMessage()
*/
public String getMessage() 
{
  if (!specialConstructor)
  {
    return super.getMessage();
  }
  int maxSize = getExpectedTokenSequencesMaxSize();
  StringBuffer expected = buildExpectedTokenMessage();
  StringBuffer retval = buildShortMessage(maxSize);
  if (expectedTokenSequences.length == 1)
  {
    retval.append(Messages.ParseException_expecting).append(eol).append("    "); 
  }
  else 
  {
    retval.append(Messages.ParseException_expection_oneof).append(eol).append("    "); 
  }
  retval.append(expected);
  return retval.toString();
}
origin: org.eclipse/org.eclipse.datatools.sqltools.sql

/**
 * This method has the standard behavior when this object has been created using the standard constructors.
 * Otherwise, it uses "currentToken" to generate a parse error message and returns it.
 * If this object has been created due to a parse error, and you do not catch it (it gets thrown from the parser),
 * then this method is called during the printing of the final stack trace, and hence the correct error message gets
 * displayed.
 * @see #getMessage()
*/
public String getShortMessage() 
{
  if (!specialConstructor)
  {
    return super.getMessage();
  }
  int maxSize = getExpectedTokenSequencesMaxSize();
  StringBuffer retval = buildShortMessage(maxSize);
  return retval.toString();
}
origin: org.eclipse/org.eclipse.datatools.sqltools.sqleditor

/**
 * create markers according to the parse exceptions
 * 
 * @param exceptions Collections of ParseException
 * @throws CoreException
 */
private void updateErrorAnnotation(ArrayList exceptions)
{
  try
  {
    for (Iterator iter = exceptions.iterator(); iter.hasNext();)
    {
      //create markers according to the parse exceptions
      ParseException ex = (ParseException) iter.next();
      HashMap attrs = new HashMap();
      attrs.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
      String storageName = "";//$NON-NLS-1$
      if (!(_input instanceof IFileEditorInput)) {
        storageName = _input.getName() + ": ";//$NON-NLS-1$
      }
      attrs.put(IMarker.MESSAGE, storageName + ex.getMessage());
      attrs.put(ISQLEditorMarker.SHORT_MESSAGE, storageName + ex.getShortMessage());
      updateAnnotation(ex, EditorConstants.SYNTAX_MARKER_TYPE, attrs);
    }
  }
  catch (CoreException e)
  {
    SQLEditorPlugin.getDefault().log(SQLEditorResources.SQLUpdater_error_annotation, e); 
  }
}
origin: org.eclipse/org.eclipse.datatools.sqltools.sqleditor

/**
 * create portable task markers according to the parse exceptions
 * 
 * @param exceptions Collections of ParseException
 * @throws CoreException
 */
private void updatePortableAnnotation(ArrayList exceptions)
{
  try
  {
    for (Iterator iter = exceptions.iterator(); iter.hasNext();)
    {
      //create markers according to the parse exceptions
      ParseException ex = (ParseException) iter.next();
      HashMap attrs = new HashMap();
      attrs.put(IMarker.USER_EDITABLE, Boolean.FALSE);
      String storageName = "";//$NON-NLS-1$
      if (!(_input instanceof IFileEditorInput)) {
        storageName = _input.getName() + ": ";//$NON-NLS-1$
      }
      attrs.put(IMarker.MESSAGE, storageName
        + NLS.bind(SQLEditorResources.SQLUpdater_nonportable, (new String[]{_portableTarget})) + ex.getMessage()); 
      updateAnnotation(ex, EditorConstants.PORTABILITY_MARKER_TYPE, attrs);
    }
  }
  catch (CoreException e)
  {
    SQLEditorPlugin.getDefault().log(SQLEditorResources.SQLUpdater_error_annotation, e); 
  }
}
org.eclipse.datatools.sqltools.sql.parserParseException

Javadoc

This exception is thrown when parse errors are encountered. You can explicitly create objects of this exception type by calling the method generateParseException in the generated parser. You can modify this class to customize your error reporting mechanisms so long as you retain the public fields.

Most used methods

  • add_escapes
    Used to convert raw characters to their escaped version when these raw version cannot be used as par
  • buildExpectedTokenMessage
  • buildShortMessage
  • getExpectedTokenSequencesMaxSize
  • getMessage
    This method has the standard behavior when this object has been created using the standard construct
  • getShortMessage
    This method has the standard behavior when this object has been created using the standard construct

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Join (org.hibernate.mapping)
  • Top plugins for WebStorm
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