Examples of Token


Examples of models.Token

            flash("error", Messages.get("error.technical"));
            Form<AskForm> askForm = form(AskForm.class);
            return badRequest(ask.render(askForm));
        }

        Token resetToken = Token.findByTokenAndType(token, Token.TypeToken.password);
        if (resetToken == null) {
            flash("error", Messages.get("error.technical"));
            Form<AskForm> askForm = form(AskForm.class);
            return badRequest(ask.render(askForm));
        }

        if (resetToken.isExpired()) {
            resetToken.delete();
            flash("error", Messages.get("error.expiredresetlink"));
            Form<AskForm> askForm = form(AskForm.class);
            return badRequest(ask.render(askForm));
        }
View Full Code Here

Examples of murban.exerciser.api.models.Token

            return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ex.getMessage()).build();
        }
        if (userid == null || userid.length() < 3) {
            return Response.status(Response.Status.BAD_REQUEST).entity("userid is required with min. length 3 characters").build();
        }
        Token token = tokenFacade.createToken(userid);
        return Response.status(Response.Status.OK).entity(token).build();
    }
View Full Code Here

Examples of net.asfun.jangod.parse.Token

    tree(root, parser, RootNode.TREE_ROOT_END);
    return root;
  }
 
  static void tree(Node node, TokenParser parser, String endName) {
    Token token;
    TagToken tag;
    MacroToken macro;
    while( parser.hasNext() ) {
      token = parser.next();
      switch(token.getType()) {
        case TOKEN_FIXED :
          TextNode tn = new TextNode((FixedToken)token);
          node.add(tn);
          break;
        case TOKEN_NOTE :
View Full Code Here

Examples of net.percederberg.grammatica.parser.Token

        TokenPattern  pattern;
        String        name;
        int           type;
        String        str;
        Token         token;
        Node          child;

        // Create token pattern
        name = getIdentifier((Token) getChildAt(node, 0));
        child = getChildAt(node, 2);
        type = getIntValue(child, 0);
        str = getStringValue(child, 1);
        pattern = new TokenPattern(nextTokenId++, name, type, str);

        // Process optional ignore or error
        if (node.getChildCount() == 4) {
            child = getChildAt(node, 3);
            token = (Token) getValue(child, 0);
            str = null;
            if (child.getValueCount() == 2) {
                str = getStringValue(child, 1);
            }
            switch (token.getId()) {
            case GrammarConstants.IGNORE:
                if (str == null) {
                    pattern.setIgnore();
                } else {
                    pattern.setIgnore(str);
View Full Code Here

Examples of net.sf.jcontracts.antlr.Token

        tokenNames_ = TOKEN_NAMES;
    }

    public final Grammar class_def(Hierarchy hier) throws ParserException
    {
        Token preamble = null;
        Token sub = null;
        Token sup = null;
        Token memberA = null;
        Grammar gr = null;
        IndexedVector rules = new IndexedVector(100);
        IndexedVector classOptions = null;
        try
        {
            if (la_1 == 5)
            {
                preamble = LT(1);
                match(5);
            }
            match(6);
            sub = LT(1);
            match(7);
            match(8);
            sup = LT(1);
            match(7);
            match(9);
            gr = hier.getGrammar(sub.getText());
            if (gr != null)
            {
                net.sf.jcontracts.antlr.Tool.toolError("redefinition of grammar " + gr.getName() + " ignored");
                gr = null;
            }
            else
            {
                gr = new Grammar(sub.getText(), sup.getText(), rules);
                if (preamble != null)
                {
                    gr.setPreambleAction(preamble.getText());
                }
            }
            if (la_1 == 17)
            {
                classOptions = optionSpec(gr);
            }
            if (gr != null)
            {
                gr.setOptions(classOptions);
            }
            if (la_1 == 10)
            {
                tokensSpec();
            }
            if (la_1 == 5)
            {
                memberA = LT(1);
                match(5);
                gr.setMemberAction(memberA.getText());
            }
            int _cnt = 0;
            do
            {
                if (_tokenSet_2.member(la_1))
View Full Code Here

Examples of net.sourceforge.chaperon.grammar.token.Token

      for (j = 0; j < _ntsymbols.getSymbolCount(); j++)
        _table.setTransition(i, j, 0);

    // for all itemsets I in collection C
    ItemSet I;
    Token token;
    IntegerList reduceproductions;
    int highestproduction, priority;
    SymbolList shiftsymbols, reducesymbols;

    for (i = 0; i < _C.getSize(); i++)
    {
      I = _C.get(i);

      shiftsymbols = I.getShiftSymbols(); // Transition symbols for shift actions
      reducesymbols = I.getReduceSymbols(); // Lookahead symbols for reduce actions

      for (j = 0; j < _tsymbols.getSymbolCount(); j++)
      {
        reduceproductions = I.getReduceProductions(_tsymbols.getSymbol(j));
        priority = -1;
        highestproduction = -1;
        for (k = 0; k < reduceproductions.getSize(); k++)
        {
          /*if ((_grammar.getProductionList().getProduction(reduceproductions.get(k)).getSymbol().equals(
                      _grammar.getStartSymbol())) && (_tsymbols.getSymbol(j).equals(endsymbol)))
            _table.setAcceptAction(i, j, reduceproductions.get(k));*/

          if (_grammar.getProductionList().getProduction(reduceproductions.get(k)).getPriority()
                  > priority)
          {
            highestproduction = reduceproductions.get(k);
            priority = _grammar.getProductionList().getProduction(highestproduction).getPriority();
          }
        }

        //if (!_table.isAcceptAction(i, j))

        if (shiftsymbols.contains(_tsymbols.getSymbol(j)))
        {
          if (reducesymbols.contains(_tsymbols.getSymbol(j)))
          {
            token = _grammar.getTokenList().getToken(_tsymbols.getSymbol(j));

            if (token.getPriority() > priority)
            {
              _table.setShiftAction(i, j, I.getTransition(_tsymbols.getSymbol(j)));

              if (_logger!=null)
                _logger.warn("Shift/Reduce Conflict State "+i+" between"+
                             System.getProperty(("line.separator"))+
                             token+System.getProperty(("line.separator"))+
                             _grammar.getProductionList().getProduction(highestproduction)+
                             System.getProperty(("line.separator"))+
                             "The parser will shift");
            }
            else if (token.getPriority() < priority)
            {
              /*if ((_grammar.getProductionList().getProduction(highestproduction).getSymbol().equals(
                      _grammar.getStartSymbol()))
                   && (_tsymbols.getSymbol(j).equals(endsymbol)))
                _table.setAcceptAction(i, j, highestproduction);
              else*/
                _table.setReduceAction(i, j, highestproduction);

              if (_logger!=null)   
                _logger.warn("Shift/Reduce Conflict State "+i+" between"+
                             System.getProperty(("line.separator"))+
                             token+System.getProperty(("line.separator"))+
                             _grammar.getProductionList().getProduction(highestproduction)+
                             System.getProperty(("line.separator"))+
                             "The parser will reduce");
            }
            else
            {
              if (token.getAssociativity()==Associativity.RIGHT)
              {
                _table.setShiftAction(i, j, I.getTransition(_tsymbols.getSymbol(j)));

                if (_logger!=null)   
                  _logger.warn("Shift/Reduce Conflict State "+i+" between"+
                               System.getProperty(("line.separator"))+
                               token+System.getProperty(("line.separator"))+
                               _grammar.getProductionList().getProduction(highestproduction)+
                               System.getProperty(("line.separator"))+
                               "The parser will shift");
              }
              else if (token.getAssociativity()==Associativity.LEFT)
              {
                /*if ((_grammar.getProductionList().getProduction(highestproduction).getSymbol().equals(
                        _grammar.getStartSymbol()))
                    && (_tsymbols.getSymbol(j).equals(endsymbol)))
                  _table.setAcceptAction(i, j, highestproduction);
View Full Code Here

Examples of net.sourceforge.veditor.parser.vhdl.Token

    // (cases can be nested)
    int incase = 0;
    int use;
    int EOS;
    for(int i=0;i < tokens.size();i++){
      Token token=tokens.get(i);
      if(token.image.equals("(")) {
        int openParan1=i;
        int closeParan1=skipToCloseParan(tokens, openParan1+1);

        // skip if there are no parameters
View Full Code Here

Examples of org.activiti.engine.impl.juel.Scanner.Token

  /**
   * consume current token (get next token).
   * @return the consumed token (which was the current token when calling this method)
   */
  protected final Token consumeToken() throws ScanException, ParseException {
    Token result = token;
    if (lookahead.isEmpty()) {
      token = scanner.next();
      position = scanner.getPosition();
    } else {
      LookaheadToken next = lookahead.remove(0);
View Full Code Here

Examples of org.adjective.syntactic.parser.jj.Token

    }

    public ASTPrimitiveType(final BaseType baseType)
    {
        this(JavaParserTreeConstants.JJTPRIMITIVETYPE);
        final Token token = new Token();
        switch (baseType)
        {
            case BOOLEAN:
                token.image = "boolean";
                token.kind = JavaParserConstants.BOOLEAN;
View Full Code Here

Examples of org.agorava.api.oauth.Token

     */
    public Token extract(String response) {
        Preconditions.checkEmptyString(response, "Response body is incorrect. Can't extract a token from an empty string");
        String token = extract(response, TOKEN_REGEX);
        String secret = extract(response, SECRET_REGEX);
        return new Token(token, secret);
    }
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.