Examples of Token


Examples of org.fife.ui.rsyntaxtextarea.Token

  @Test
  public void testUnderstanding() {
   
    String code = "f = function(x) {\n return(1+x);\n}";
    JavaScriptTokenMaker tokenMaker = new JavaScriptTokenMaker();
    Token tokenList = tokenMaker.getTokenList(new Segment(code.toCharArray(), 0, code.length()), 0, 0);
   
    tokenList = dumpTokenList(tokenList);
  }
View Full Code Here

Examples of org.fireflow.kernel.impl.Token

* @author wmj2003
*/
public class TokenRowMapper implements RowMapper {

  public Object mapRow(ResultSet rs, int rowNum) throws SQLException   {
    Token token = new Token();
    token.setId(rs.getString("id"));
    token.setAlive(rs.getInt("alive") == 1 ? true : false);
    token.setValue(rs.getInt("value"));
    token.setNodeId(rs.getString("node_id"));
    token.setProcessInstanceId(rs.getString("processinstance_id"));

    token.setStepNumber(rs.getInt("step_number"));
    token.setFromActivityId(rs.getString("from_activity_id"));

    return token;
  }
View Full Code Here

Examples of org.glassfish.jersey.message.internal.Token

    }

    @Test
    public void testToken() throws ParseException {
        final String token = "gzip";
        new Token(token);
    }
View Full Code Here

Examples of org.goda.chronic.utils.Token

    protected static List<Token> baseTokenize(String text) {
        String[] words = text.split(" ");
        List<Token> tokens = new LinkedList<Token>();

        for (String word : words) {
            tokens.add(new Token(word));
        }

        return tokens;
    }
View Full Code Here

Examples of org.graphstream.util.parser.Token

    else
      curLexState = lexState;
  }

  protected Token jjFillToken() {
    final Token t;
    final String curTokenImage;
    final int beginLine;
    final int endLine;
    final int beginColumn;
    final int endColumn;
View Full Code Here

Examples of org.h2.jaqu.Token

            readByteCode();
            if (endOfMethod) {
                return stack.pop();
            }
            if (condition) {
                Token c = stack.pop();
                Stack<Token> currentStack = new Stack<Token>();
                currentStack.addAll(stack);
                ArrayList<Token> currentVariables = new ArrayList<Token>();
                currentVariables.addAll(variables);
                int branch = nextPc;
                Token a = getResult();
                stack = currentStack;
                variables = currentVariables;
                pos = branch + startByteCode;
                Token b = getResult();
                if (a.equals("0") && b.equals("1")) {
                    return c;
                } else if (a.equals("1") && b.equals("0")) {
                    return Not.get(c);
                } else if (b.equals("0")) {
                    return And.get(Not.get(c), a);
                } else if (a.equals("0")) {
                    return And.get(c, b);
                } else if (b.equals("1")) {
                    return Or.get(c, a);
                } else if (a.equals("1")) {
                    return And.get(Not.get(c), b);
                }
                return CaseWhen.get(c, b, a);
View Full Code Here

Examples of org.hsqldb.cmdline.sqltool.Token

    synchronized protected void scanpass(TokenSource ts)
                                     throws SqlToolError, SQLException {
        boolean rollbackUncoms = true;
        String nestingCommand;
        Token token = null;

        if (shared.userVars.size() > 0) {
            plMode = true;
        }

        try {
            while (true) try {
                if (preempt) {
                    token = buffer;
                    preempt = false;
                } else {
                    token = ts.yylex();
                    logger.finest("SqlFile got new token:  " + token);
                }
                if (token == null) break;

                nestingCommand = nestingCommand(token);
                if (nestingCommand != null) {
                    if (token.nestedBlock == null) {
                        token.nestedBlock = seekTokenSource(nestingCommand);
                        /* This command (and the same recursive call inside
                         * of the seekTokenSource() method) ensure that all
                         * "blocks" are tokenized immediately as block
                         * commands are encountered, and the blocks are
                         * tokenized in their entirety all the way to the
                         * leaves.
                         */
                    }
                    processBlock(token);
                        /* processBlock recurses through scanpass(),
                         * which processes the nested commands which have
                         * (in all cases) already beeen tokenized.
                         */
                    continue;
                }

                switch (token.type) {
                    case Token.SYNTAX_ERR_TYPE:
                        throw new SqlToolError(SqltoolRB.input_malformat.getString());
                        // Will get here if Scanner can't match input to any
                        // known command type.
                        // An easy way to get here is to start a command with
                        // quotes.
                    case Token.UNTERM_TYPE:
                        throw new SqlToolError(
                                SqltoolRB.input_unterminated.getString(
                                token.val));
                    case Token.RAW_TYPE:
                    case Token.RAWEXEC_TYPE:
                        /*
                         * A real problem in this block is that the Scanner
                         * has already displayed the next prompt at this
                         * point.  We handle this specially within this
                         * block, but if we throw, the handler will not
                         * know that the prompt has to be re-displayed.
                         * I.e., KNOWN ISSUE:  For some errors caught during
                         * raw command execution, interactive users will not
                         * get a prompt to tell them to proceed.
                         */
                        if (token.val == null) token.val = "";
                        /*
                         * Don't have time know to figure out whether it would
                         * ever be useful to send just (non-zero) whitespace
                         * to the DB.  Prohibiting for now.
                         */
                        if (token.val.trim().length() < 1) {
                            throw new SqlToolError(
                                    SqltoolRB.raw_empty.getString());
                        }
                        int receivedType = token.type;
                        token.type = Token.SQL_TYPE;
                        if (setBuf(token) && receivedType == Token.RAW_TYPE
                                && interactive) {
                            stdprintln("");
                            stdprintln(SqltoolRB.raw_movedtobuffer.getString());
                            stdprint(primaryPrompt);
                            // All of these stdprint*'s are to work around a
                            // very complicated issue where the Scanner
                            // has already displayed the next prompt before
                            // we can display our status message.
                        }
                        if (receivedType == Token.RAWEXEC_TYPE) {
                            historize();
                            processSQL();
                        }
                        continue;
                    case Token.MACRO_TYPE:
                        processMacro(token);
                        continue;
                    case Token.PL_TYPE:
                        setBuf(token);
                        historize();
                        processPL(null);
                        continue;
                    case Token.SPECIAL_TYPE:
                        setBuf(token);
                        historize();
                        processSpecial(null);
                        continue;
                    case Token.EDIT_TYPE:
                        // Scanner only returns EDIT_TYPEs in interactive mode
                        processBuffHist(token);
                        continue;
                    case Token.BUFFER_TYPE:
                        token.type = Token.SQL_TYPE;
                        if (setBuf(token)) {
                            stdprintln(
                                    SqltoolRB.input_movedtobuffer.getString());
                        }
                        continue;
                    case Token.SQL_TYPE:
                        if (token.val == null) token.val = "";
                        setBuf(token);
                        historize();
                        processSQL();
                        continue;
                    default:
                        throw new RuntimeException(
                                "Internal assertion failed.  "
                                + "Unexpected token type: "
                                + token.getTypeString());
                }
            } catch (BadSpecial bs) {
                // BadSpecials ALWAYS have non-null getMessage().
                if (token == null) {
                    errprintln(SqltoolRB.errorat.getString(
                            inputStreamLabel, "?", "?", bs.getMessage()));
                } else {
                    errprintln(SqltoolRB.errorat.getString(
                            inputStreamLabel,
                            Integer.toString(token.line),
                            token.reconstitute(),
                            bs.getMessage(), bs.getMessage()));
                }
                Throwable cause = bs.getCause();
                if (cause != null) {
                    errprintln(SqltoolRB.causereport.getString(
                            cause.toString()));

                }

                if (!continueOnError) {
                    throw new SqlToolError(bs);
                }
            } catch (SQLException se) {
                //se.printStackTrace();
                errprintln("SQL " + SqltoolRB.errorat.getString(
                        inputStreamLabel,
                        ((token == null) ? "?"
                                         : Integer.toString(token.line)),
                        lastSqlStatement,
                        se.getMessage()));
                // It's possible that we could have
                // SQLException.getMessage() == null, but if so, I think
                // it reasonable to show "null".  That's a DB inadequacy.

                if (!continueOnError) {
                    throw se;
                }
            } catch (BreakException be) {
                String msg = be.getMessage();

                if (recursed) {
                    rollbackUncoms = false;
                    // Recursion level will exit by rethrowing the BE.
                    // We set rollbackUncoms to false because only the
                    // top level should detect break errors and
                    // possibly roll back.
                } else if (msg == null || msg.equals("file")) {
                    break;
                } else {
                    errprintln(SqltoolRB.break_unsatisfied.getString(msg));
                }

                if (recursed ||!continueOnError) {
                    throw be;
                }
            } catch (ContinueException ce) {
                String msg = ce.getMessage();

                if (recursed) {
                    rollbackUncoms = false;
                } else {
                    errprintln(SqltoolRB.continue_unsatisfied.getString(msg));
                }

                if (recursed ||!continueOnError) {
                    throw ce;
                }
            } catch (QuitNow qn) {
                throw qn;
            } catch (SqlToolError ste) {
                StringBuffer sb = new StringBuffer(SqltoolRB.errorat.getString(
                    /* WARNING:  I have removed an extra LS appended to
                     * non-null ste.getMessages() below because I believe that
                     * it is unnecessary (and causes inconsistent blank lines
                     * to be written).
                     * If I am wrong and this is needed for Scanner display or
                     * something, restore it.
                     */
                    ((token == null)
                            ? (new String[] {
                                inputStreamLabel, "?", "?",
                                ((ste.getMessage() == null)
                                        ? "" : ste.getMessage())
                              })
                            : (new String[] {
                                inputStreamLabel, Integer.toString(token.line),
                                ((token.val == null) ? "" : token.reconstitute()),
                                ((ste.getMessage() == null)
                                        ? "" : ste.getMessage())
                              }))
                ));
                Throwable cause = ste.getCause();
View Full Code Here

Examples of org.itsnat.impl.core.css.lex.Token

    }

    public boolean setFloatValueInternal(SourceCode cssTextCode)
    {
        // Se supone que hay almenos un token
        Token token0 = cssTextCode.getToken(0);
        if (!(token0 instanceof FloatNumber))
            return false;

        FloatNumber tokenNumber = (FloatNumber)token0;
        float floatValue = tokenNumber.getFloat();
        short unitType = -1;

        if (cssTextCode.tokenCount() > 2)
            throw new DOMException(DOMException.INVALID_ACCESS_ERR,"CSS: number format error: " + cssTextCode.toString());

        if (cssTextCode.tokenCount() == 1)
        {
            // No tiene sufijo
            unitType = CSS_NUMBER;
        }
        else
        {
            // Tiene sufijo
            Token token1 = cssTextCode.getToken(1);
            if (!(token1 instanceof Identifier) &&  !(token1 instanceof Percent))
                throw new DOMException(DOMException.INVALID_ACCESS_ERR,"CSS: expected a unit identifier: " + cssTextCode.toString());

            String suffix = token1.toString();
            suffix = suffix.toLowerCase();

            if ("%".equals(suffix))
            {
                unitType = CSS_PERCENTAGE;
View Full Code Here

Examples of org.jacorb.idl.runtime.token

        {
            if( isScope( result_str ) )
            {
                parser.openScope();
            }
            return new token( keyword_num.intValue() );
        }

        // not a keyword, so treat as identifier after verifying
        // case sensitivity rules and prefacing with an _
        // if it collides with a Java keyword.
View Full Code Here

Examples of org.jbehave.core.story.codegen.sablecc.node.Token

        {
            token = getToken();
            filter();
        }

        Token result = token;
        token = null;
        return result;
    }
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.