Examples of Token


Examples of edu.luc.cs.laufer.cs313.occurences.Token

   * Test method for
   * {@link edu.luc.cs.laufer.cs313.occurences.DefaultToken#getLine()}.
   */
  @Test
  public void testGetWord() {
    Token token = new DefaultToken("abc", 5);
    assertEquals("abc", token.getWord());
  }
View Full Code Here

Examples of edu.luc.cs.laufer.cs473.index.Token

   * Test method for
   * {@link edu.luc.cs.laufer.cs473.index.DefaultToken#getLine()}.
   */
  @Test
  public void testGetWord() {
    Token token = new DefaultToken("abc", 5);
    assertEquals("abc", token.getWord());
  }
View Full Code Here

Examples of edu.umd.cs.findbugs.Token

            // keeping track of where the catch block is reported
            // to start
            ArrayList<Token> tokenList = new ArrayList<Token>(40);
            int eolOfCatchBlockStart = -1;
            for (int line = scanStartLine; line < scanStartLine + MAX_LINES;) {
                Token token = tokenizer.next();
                int kind = token.getKind();
                if (kind == Token.EOF) {
                    break;
                }

                if (kind == Token.EOL) {
                    if (line == startLine) {
                        eolOfCatchBlockStart = tokenList.size();
                    }
                    ++line;
                }

                tokenList.add(token);
            }

            if (eolOfCatchBlockStart < 0)
            {
                return false; // Couldn't scan line reported as start of catch
                // block
            }

            // Starting at the end of the line reported as the start of the
            // catch block,
            // scan backwards for the token "catch".
            ListIterator<Token> iter = tokenList.listIterator(eolOfCatchBlockStart);
            boolean foundCatch = false;

            while (iter.hasPrevious()) {
                Token token = iter.previous();
                if (token.getKind() == Token.WORD && token.getLexeme().equals("catch")) {
                    foundCatch = true;
                    break;
                }
            }

            if (!foundCatch)
            {
                return false; // Couldn't find "catch" keyword
            }

            // Scan forward from the "catch" keyword to see what text
            // is in the handler block. If the block is non-empty,
            // then we suppress the warning (on the theory that the
            // programmer has indicated that there is a good reason
            // that the exception is ignored).
            boolean done = false;
            int numLines = 0;
            int state = START;
            int level = 0;
            do {
                if (!iter.hasNext()) {
                    break;
                }

                Token token = iter.next();
                int type = token.getKind();
                String value = token.getLexeme();

                switch (type) {
                case Token.EOL:
                    if (DEBUG) {
                        System.out.println("Saw token: [EOL]");
View Full Code Here

Examples of er.chronic.utils.Token

    super(type);
  }

  public static List<Token> scan(List<Token> tokens, Options options) {
    for (int i = 0; i < tokens.size(); i++) {
      Token token = tokens.get(i);
      Token postToken = null;
      if (i < tokens.size() - 1) {
        postToken = tokens.get(i + 1);
      }
      Scalar t;
      t = Scalar.scan(token, postToken, options);
View Full Code Here

Examples of etch.compiler.Token

    addType( Message.class );
    addType( Service.class );
   
    if (args.length != 1)
      throw new ParseException( String.format( "args.length != 1" ) );
    Token arg = args[0];
    if (arg.kind != EtchGrammarConstants.INTEGER)
      throw new ParseException( String.format( "Timeout arg should be integer constant: "+arg.image ) );
    int v = Integer.parseInt( arg.image );
    if (v < 0)
      throw new ParseException( String.format( "Timeout arg should be integer constant >= 0: "+arg.image ) );
View Full Code Here

Examples of fasp.parser.tokenizer.Token

   * @throws fasp.parser.ParseException
   */
  @Override
  public FaspVariable parse(TokenState st) throws ParseException {
    if (getResult() == null) {
      Token lookahead = st.lookahead();
      if(lookahead.getType().equals(Token.Type.SYMBOL)) {
        SymbolToken sym = (SymbolToken)lookahead;
        if(Character.isUpperCase(sym.getSymbol().charAt(0))) {
          st.eat();
          return new FaspVariable(sym.getSymbol());
        } else {
View Full Code Here

Examples of flex2.compiler.mxml.Token

        textDepth = 0;
    }

    public void endDocument() throws SAXException
    {
        Token t = new Token();
        t.kind = ParserConstants.EOF;
        assignTokenPosition(t);
        t.image = "";
        saxEvents.add(t);
        kind = ParserConstants.EOF;
View Full Code Here

Examples of fri.patterns.interpreter.parsergenerator.Token

        if (listeners != null && listeners.size() > 0// creating a token takes time, do it only when listeners are present
          fireTokenReceived(createToken(item.getTokenIdentifier(), item.getResultTree(), lexerSemantic), true);
        return getNextToken(expectedTokenSymbols);
      }
      else  {
        Token token = createToken(item.getTokenIdentifier(), item.getResultTree(), lexerSemantic);
        fireTokenReceived(token, false);
        return token;
      }
    }
View Full Code Here

Examples of frontend.Token

    // private final void runtest(String input, Token... output) {
    // "..." arbitrage number of parameters
    private void runtest(String input, Token... output) {
        Lexer lexer = new Lexer(new StringReader(input));
        int i=0;
        Token actual, expected;
        try {
            do {
                //System.out.println("testing "+output[i]);
                assertTrue(i < output.length);
                expected = output[i++];
                try {
                    actual = lexer.nextToken();
                    assertEquals(expected, actual);
                } catch(Error e) {
                    if(expected != null)
                        fail(e.getMessage());
                    return;
                }
            } while(!actual.isEOF());
        } catch (IOException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
View Full Code Here

Examples of games.stendhal.server.entity.item.token.Token

   *            x-position
   * @param y
   *            y-position
   */
  private void addTokenToWorld(final int x, final int y) {
    final Token token = (Token) SingletonRepository.getEntityManager().getItem("arrow game token");
    token.setPosition(x, y);
    token.setTokenMoveListener(this);
    zone.add(token, false);
    tokens.add(token);
  }
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.