Examples of Statement


Examples of com.google.minijoe.compiler.ast.Statement

  private Statement parseFunctionDeclaration() throws CompilerException {
    return new FunctionDeclaration(parseFunctionLiteral(true));
  }

  public Statement parseStatement() throws CompilerException {
    Statement statement;
    int lineNumber;

    if (Config.LINENUMBER) {
      lineNumber = getLineNumber();
    }

    if (nextToken == Token.OPERATOR_SEMICOLON) {
      readToken(Token.OPERATOR_SEMICOLON);
      statement = new EmptyStatement();

    } else if (nextToken == Token.OPERATOR_OPENBRACE) {
      statement = parseBlockStatement();

    } else if (nextToken == Token.KEYWORD_BREAK) {
      statement = parseBreakStatement();

    } else if (nextToken == Token.KEYWORD_CONTINUE) {
      statement = parseContinueStatement();

    } else if (nextToken == Token.KEYWORD_DO) {
      statement = parseDoStatement();

    } else if (nextToken == Token.KEYWORD_FOR) {
      statement = parseForStatement();

    } else if (nextToken == Token.KEYWORD_IF) {
      statement = parseIfStatement();

    } else if (nextToken == Token.KEYWORD_RETURN) {
      statement = parseReturnStatement();

    } else if (nextToken == Token.KEYWORD_THROW) {
      statement = parseThrowStatement();

    } else if (nextToken == Token.KEYWORD_TRY) {
      statement = parseTryStatement();

    } else if (nextToken == Token.KEYWORD_SWITCH) {
      statement = parseSwitchStatement();

    } else if (nextToken == Token.KEYWORD_VAR) {
      statement = parseVariableStatement();

    } else if (nextToken == Token.KEYWORD_WHILE) {
      statement = parseWhileStatement();

    } else if (nextToken == Token.KEYWORD_WITH) {
      statement = parseWithStatement();

    } else {
      statement = parseExpressionStatement();

    }

    if (Config.LINENUMBER) {
      statement.setLineNumber(lineNumber);
    }

    return statement;
  }
View Full Code Here

Examples of com.googlecode.mjorm.mql.Statement

   */
  protected Statement createStatement(String mql) {
    if (cacheStatements && statementCache.containsKey(mql)) {
      return statementCache.get(mql);
    }
    Statement ret = getMongoDao().createStatement(mql);
    if (cacheStatements) {
      statementCache.put(mql, ret);
    }
    return ret;
  }
View Full Code Here

Examples of com.googlecode.openbeans.Statement

            {
              if (statements == null)
              {
                statements = new Statement[operations.size()];
              }
              statements[i] = new Statement(getResultValue(), "set", new Object[] { Integer.valueOf(i), //$NON-NLS-1$
                  cmd.getResultValue() });
              if ((i + 1) == operations.size())
              {
                for (int j = 0; j < operations.size(); ++j)
                {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Statement

    Model trustedModel = JenaUtil.getModelFromGraph(trustedGraph);
    final Resource configRes = trustedModel.getResource(configuration.getURIRef());
    try {
      GVSServerLauncher.launchGVSServer(store, new ServerBinding() {
        public InetAddress getInetAddress() {
          Statement nicStatement = configRes.getProperty(HTTPLISTENER.networkInterface);
          if (nicStatement != null) {
            try {
              return InetAddress.getByName(nicStatement.getString());
            } catch (UnknownHostException e) {
              throw new RuntimeException(e);
            }
          }
          return null;
View Full Code Here

Examples of com.hpctoday.fada.Statement

          IASTUnaryExpression unOperand1 = (IASTUnaryExpression)operand1;
          operand1 = unOperand1.getOperand();
        }
       
        if(operand1 instanceof IASTIdExpression){
          Statement stmt = new Statement(new Assignment (operand1.getRawSignature(),rhs));
          if(inElse) parent.Enclose(stmt, true);
          else parent.Enclose(stmt, false);
        }
        else if (operand1 instanceof IASTArraySubscriptExpression) {
          ArrayAccessVisitor aVisitor = new ArrayAccessVisitor();
          operand1.accept(aVisitor);
          List<Expression> flist = aVisitor.indices;
          Collections.reverse(flist);
         
          Statement stmt = new Statement(new Assignment (aVisitor.id, new FADA_Index(flist), rhs));

          if(inElse) parent.Enclose(stmt, true);
          else parent.Enclose(stmt, false);
        } else {
         
          //bexpr.getOperand1().accept(lhsVisitor);
          //FadaExpression lhs = lhsVisitor.getExpr();
         
         
          System.err.println("StmtVisitor.visit: unknown binary operand " + bexpr.getOperand1() + " " +  expr.getRawSignature());
         
        }
      } else {
        System.err.println("StmtVisitor.visit: unknown binary expression " + expr.getRawSignature());
      }
    } else if(expr instanceof IASTUnaryExpression){
      visit((IASTUnaryExpression)expr);
     
    } else if (expr instanceof IASTFunctionCallExpression){
      ExprVisitor visitor = new ExprVisitor();
      expr.accept(visitor);
     
      Statement stmt = new Statement(new Assignment ("", visitor.getExpr()));
      if(inElse) parent.Enclose(stmt, true);
      else parent.Enclose(stmt, false);
    } else {
      System.err.println("StmtVisitor.visit: unknown expression (" + expr.getClass() + ") " + expr.getRawSignature() );
    }
View Full Code Here

Examples of com.icona.tree.nodes.Statement

    // $ANTLR start "external_declaration"
    // C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:90:1: external_declaration : (d= declaration |stmt= statement | class_interface | class_implementation | protocol_declaration | protocol_declaration_list );
    public final void external_declaration() throws RecognitionException {
        ListDeclaration d =null;

        Statement stmt =null;


        try {
            // C:\\Users\\line47\\workspace\\ObjCFYPA\\src\\com\\icona\\antlr\\main\\ObjectiveC.g:92:2: (d= declaration |stmt= statement | class_interface | class_implementation | protocol_declaration | protocol_declaration_list )
            int alt2=6;
View Full Code Here

Examples of com.jme3.util.blockparser.Statement

        fragLanguage = null;
    }

    private void loadFromRoot(List<Statement> roots) throws IOException{      
        if (roots.size() == 2){
            Statement exception = roots.get(0);
            String line = exception.getLine();
            if (line.startsWith("Exception")){
                throw new AssetLoadException(line.substring("Exception ".length()));
            }else{
                throw new IOException("In multiroot material, expected first statement to be 'Exception'");
            }
        }else if (roots.size() != 1){
            throw new IOException("Too many roots in J3M/J3MD file");
        }
              
        boolean extending = false;
        Statement materialStat = roots.get(0);
        String materialName = materialStat.getLine();
        if (materialName.startsWith("MaterialDef")){
            materialName = materialName.substring("MaterialDef ".length()).trim();
            extending = false;
        }else if (materialName.startsWith("Material")){
            materialName = materialName.substring("Material ".length()).trim();
            extending = true;
        }else{
            throw new IOException("Specified file is not a Material file");
        }
       
        String[] split = materialName.split(":", 2);
       
        if (materialName.equals("")){
            throw new MatParseException("Material name cannot be empty", materialStat);        
        }

        if (split.length == 2){
            if (!extending){
                throw new MatParseException("Must use 'Material' when extending.", materialStat);
            }

            String extendedMat = split[1].trim();

            MaterialDef def = (MaterialDef) assetManager.loadAsset(new AssetKey(extendedMat));
            if (def == null) {
                throw new MatParseException("Extended material " + extendedMat + " cannot be found.", materialStat);
            }

            material = new Material(def);
            material.setKey(key);
//            material.setAssetName(fileName);
        }else if (split.length == 1){
            if (extending){
                throw new MatParseException("Expected ':', got '{'", materialStat);              
            }
            materialDef = new MaterialDef(assetManager, materialName);
            // NOTE: pass file name for defs so they can be loaded later
            materialDef.setAssetName(key.getName());
        }else{
            throw new MatParseException("Cannot use colon in material name/path", materialStat);  
        }
       
        for (Statement statement : materialStat.getContents()){
            split = statement.getLine().split("[ \\{]");
            String statType = split[0];
            if (extending){
                if (statType.equals("MaterialParameters")){
                    readExtendingMaterialParams(statement.getContents());
View Full Code Here

Examples of com.meidusa.amoeba.parser.statement.Statement

        MysqlParser parser = new MysqlParser(new StringReader(parseSql));

        // 设置函数列表。
        parser.setFunctionMap(functionMap);

        Statement stmt = null;
        try {
            stmt = parser.doParse();
        } catch (ParseException e) {
            parsingFailed = true;

            // 语句解析失败,写出日志。
            if (logger.isDebugEnabled()) {
                logger.debug("Parsing SQL failed: " + sql, e);

            } else if (logger.isWarnEnabled()) {
                logger.warn("Parsing SQL failed: " + sql);
            }
        }

        dml = (stmt instanceof DMLStatement);

        if (dml) {
            // 解析 SELECT / INSERT / UPDATE / DELETE 语句
            select = (stmt instanceof SelectStatement);
            insert = (stmt instanceof InsertStatement);
            update = (stmt instanceof UpdateStatement);
            delete = (stmt instanceof DeleteStatement);

            DMLStatement dmlStmt = (DMLStatement) stmt;

            tables = dmlStmt.getTables();

            // 处理生成的表达式
            parseExpr(dmlStmt.getExpression(), null);

            // 记录参数数目,注意: UPDATE 语句的实际参数数目要大于表达式中提取的参数数目。因此,真实地参数索引应该是:
            // index = paramIndex + indexParams.size() - paramCount - 1
            paramOffset = indexParams.size() - stmt.getParameterCount() - 1;
            paramCount += stmt.getParameterCount();
        }

    }
View Full Code Here

Examples of com.mysql.jdbc.Statement

    }
   
    public ResultSet selectQuery( String sqlStatement ) {
        System.out.println( sqlStatement );
        try {
            Statement stmt = ( Statement ) connection.getConnection().createStatement();

            return stmt.executeQuery( sqlStatement );
        } catch( SQLException e ) {
            System.out.println( e.getMessage() );
            throw new RuntimeException();
        }
    }
View Full Code Here

Examples of com.netfever.dbmanager.object.Statement

  }

  public RunnableQuery getQueryStatement(String queryName,
      String statementName) throws QueryBuilderException {
    Query query;
    Statement statement;

    if (queryName == null)
      throw new QueryBuilderException(
          "queryName parameter cannot be null.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.