Package antlr

Examples of antlr.SemanticException


    }
    catch (InvalidWithClauseException e) {
      throw e;
    }
    catch (Exception e) {
      throw new SemanticException( e.getMessage() );
    }
  }
View Full Code Here


  }

  @Override
  protected AST generatePositionalParameter(AST inputNode) throws SemanticException {
    if ( namedParameters.size() > 0 ) {
      throw new SemanticException(
          "cannot define positional parameter after any named parameters have been defined"
      );
    }
    LOG.warnf(
        "[DEPRECATION] Encountered positional parameter near line %s, column %s.  Positional parameter " +
View Full Code Here

  }

  @Override
  protected void handleResultVariableRef(AST resultVariableRef) throws SemanticException {
    if ( isSubQuery() ) {
      throw new SemanticException(
          "References to result variables in subqueries are not supported."
      );
    }
    ( (ResultVariableRefNode) resultVariableRef ).setSelectExpression(
        selectExpressionsByResultVariable.get( resultVariableRef.getText() )
View Full Code Here

    FromClause fromClause = updateStatement.getFromClause();
    if ( versioned != null ) {
      // Make sure that the persister is versioned
      Queryable persister = fromClause.getFromElement().getQueryable();
      if ( !persister.isVersioned() ) {
        throw new SemanticException( "increment option specified for update of non-versioned entity" );
      }

      VersionType versionType = persister.getVersionType();
      if ( versionType instanceof UserVersionType ) {
        throw new SemanticException( "user-defined version types not supported for increment option" );
      }

      AST eq = getASTFactory().create( HqlSqlTokenTypes.EQ, "=" );
      AST versionPropertyNode = generateVersionPropertyNode( persister );
View Full Code Here

  protected void validateMapPropertyExpression(AST node) throws SemanticException {
    try {
      FromReferenceNode fromReferenceNode = (FromReferenceNode) node;
      QueryableCollection collectionPersister = fromReferenceNode.getFromElement().getQueryableCollection();
      if ( !Map.class.isAssignableFrom( collectionPersister.getCollectionType().getReturnedClass() ) ) {
        throw new SemanticException( "node did not reference a map" );
      }
    }
    catch (SemanticException se) {
      throw se;
    }
    catch (Throwable t) {
      throw new SemanticException( "node did not reference a map" );
    }
  }
View Full Code Here

  @Override
  public void initialize() throws SemanticException {
    final Node lhs = getLeftHandOperand();
    if ( lhs == null ) {
      throw new SemanticException( "left-hand operand of a binary operator was null" );
    }

    final Node rhs = getRightHandOperand();
    if ( rhs == null ) {
      throw new SemanticException( "right-hand operand of a binary operator was null" );
    }

    final Type lhType = ( lhs instanceof SqlNode ) ? ( (SqlNode) lhs ).getDataType() : null;
    final Type rhType = ( rhs instanceof SqlNode ) ? ( (SqlNode) rhs ).getDataType() : null;
View Full Code Here

  protected abstract String expressionDescription();
  protected abstract String[] resolveColumns(QueryableCollection collectionPersister);
  protected abstract Type resolveType(QueryableCollection collectionPersister);

  protected SemanticException attemptedDereference() {
    return new SemanticException( expressionDescription() + " expression cannot be further de-referenced" );
  }
View Full Code Here

  protected SemanticException attemptedDereference() {
    return new SemanticException( expressionDescription() + " expression cannot be further de-referenced" );
  }

  protected SemanticException nonMap() {
    return new SemanticException( expressionDescription() + " expression did not reference map property" );
  }
View Full Code Here

public class BetweenOperatorNode extends SqlNode implements OperatorNode {

  public void initialize() throws SemanticException {
    final Node fixture = getFixtureOperand();
    if ( fixture == null ) {
      throw new SemanticException( "fixture operand of a between operator was null" );
    }

    final Node low = getLowOperand();
    if ( low == null ) {
      throw new SemanticException( "low operand of a between operator was null" );
    }

    final Node high = getHighOperand();
    if ( high == null ) {
      throw new SemanticException( "high operand of a between operator was null" );
    }

    check( fixture, low, high );
    check( low, high, fixture );
    check( high, fixture, low );
View Full Code Here

   */
  @Override
  public void initialize() throws SemanticException {
    final Node lhs = getLeftHandOperand();
    if ( lhs == null ) {
      throw new SemanticException( "left-hand operand of a binary operator was null" );
    }

    final Node rhs = getRightHandOperand();
    if ( rhs == null ) {
      throw new SemanticException( "right-hand operand of a binary operator was null" );
    }

    Type lhsType = extractDataType( lhs );
    Type rhsType = extractDataType( rhs );

View Full Code Here

TOP

Related Classes of antlr.SemanticException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.