Examples of Token


Examples of org.allspice.parser.parsetable.Token

   * @throws InvalidStartRule
   * @throws StateConflict
   * @throws SyntaxError
   */
  public static void main(String[] args) throws StateConflict, InvalidStartRule, StrandedSymbol, SyntaxError {
    final IteratorTokenStream iterator = new IteratorTokenStream(new Token("id",3.0),new Token("*"),new Token("id",5.0)) ;
    Parser parser = new Parser(createParseTable(),iterator) ;
    Object res = parser.parse() ;
    System.out.println("res="+res) ;
  }
View Full Code Here

Examples of org.anarres.cpp.Token

  public void run(String file) {
    try {
      pp.addInput(new FileLexerSource(new File(file)));

      for (;;) {
        Token tok = pp.token();
        if (tok == null)
          break;
        if (tok.getType() == Token.EOF)
          break;

        if (Token.getTokenName(tok.getType()).equals("{"))
          pl.incLevel();
        else if (Token.getTokenName(tok.getType()).equals("}"))
          pl.decLevel();

        if (tok.getType() != Token.P_LINE)
          pl.getCurrent().write(tok.getText().getBytes());
      }
    } catch (Exception e) {
      e.printStackTrace(System.err);
      logger.error("Preprocessor error.");
      // System.exit(1);
View Full Code Here

Examples of org.antlr.runtime.Token

        commands_return retval = new commands_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token STRINGS2=null;
        Token INTEGERS4=null;
        Token FUNCTION6=null;
        Token MACRO9=null;
        Token char_literal11=null;
        Token STRING12=null;
        Token char_literal13=null;
        Token READ14=null;
        Token EXECUTE15=null;
        Token char_literal16=null;
        Token char_literal18=null;
        Token ITERATE19=null;
        Token char_literal20=null;
        Token char_literal22=null;
        Token REVERSE23=null;
        Token char_literal24=null;
        Token char_literal26=null;
        Token ENTRY27=null;
        Token SORT31=null;
        idList_return idList3 = null;

        idList_return idList5 = null;

        id_return id7 = null;
View Full Code Here

Examples of org.antlr.runtime3_3_0.Token

    int type = adaptor.getType(t);
    buf.append("\t");
    buf.append(ID);
    buf.append("\t");
    buf.append(type);
    Token token = adaptor.getToken(t);
    int line = -1;
    int pos = -1;
    if ( token!=null ) {
      line = token.getLine();
      pos = token.getCharPositionInLine();
    }
    buf.append("\t");
    buf.append(line);
    buf.append("\t");
    buf.append(pos);
View Full Code Here

Examples of org.antlr.v4.runtime.Token

      }
      else if ( t instanceof ErrorNode) {
        return t.toString();
      }
      else if ( t instanceof TerminalNode) {
        Token symbol = ((TerminalNode)t).getSymbol();
        if (symbol != null) {
          String s = symbol.getText();
          return s;
        }
      }
    }
    // no recog for rule names
View Full Code Here

Examples of org.apache.accumulo.core.util.shell.Token

    return "turns debug logging on or off";
  }
 
  @Override
  public void registerCompletion(final Token root, final Map<Command.CompletionSet,Set<String>> special) {
    final Token debug_command = new Token(getName());
    debug_command.addSubcommand(Arrays.asList(new String[] {"on", "off"}));
    root.addSubcommand(debug_command);
  }
View Full Code Here

Examples of org.apache.agila.engine.Token

        answer = dao.lockTaskForUser(taskID, new UserID(2));
        assertTrue("Managed to lock task", answer);
    }

    public void testNewToken() {
        Token token = dao.newToken(new InstanceID(1), new NodeID(1), Token.PRE);

        assertNotNull( "Token should not be null", token );
    }
View Full Code Here

Examples of org.apache.axis.types.Token

            + out + " expected : " + in, in, out);
    }

    public void testToken() throws Exception {
        // Test xsd:token
        Token in = new Token("abc-Token-def");
        Token out = binding.echoToken(in);
        assertEquals("echoToken : incorrect return value : " + out + " expected : " + in, in, out);
    }
View Full Code Here

Examples of org.apache.axis2.databinding.types.Token

    }

    public static String convertToToken(Object jsObject) throws AxisFault {
        try {
            String str = (String) jsObject;
            return new Token(str).toString();
        } catch (IllegalArgumentException e) {
            throw new AxisFault("Unable to convert the return value to token");
        }
    }
View Full Code Here

Examples of org.apache.cassandra.dht.Token

     * @return a copy of the natural endpoints for the given token
     * @throws IllegalStateException if the number of requested replicas is greater than the number of known endpoints
     */
    public ArrayList<InetAddress> getNaturalEndpoints(Token searchToken) throws IllegalStateException
    {
        Token keyToken = TokenMetadata.firstToken(tokenMetadata.sortedTokens(), searchToken);
        ArrayList<InetAddress> endpoints = getCachedEndpoints(keyToken);
        if (endpoints == null)
        {
            TokenMetadata tokenMetadataClone = tokenMetadata.cloneOnlyTokenMap();
            keyToken = TokenMetadata.firstToken(tokenMetadataClone.sortedTokens(), searchToken);
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.