Examples of SymbolToken


Examples of fasp.parser.tokenizer.SymbolToken

    // Now parse the rule operator
    Token bodyOpTok = st.getNext();
    if(!bodyOpTok.getType().equals(Token.Type.SYMBOL))
      throw new ParseException(bodyOpTok.getLocation(),"body operator",bodyOpTok.toString());

    SymbolToken bodyOpSym = (SymbolToken)bodyOpTok;

    if(!BODYOPERATORS.containsKey(bodyOpSym.getSymbol()))
      throw new ParseException(st,unsupportedBodyOp(),bodyOpSym.getSymbol());

    MultiOperator bodyOp = BODYOPERATORS.get(bodyOpSym.getSymbol());

    // Parse the rule body
    ArrayList<Groundable> body = new BetweenParser<ArrayList<Groundable>,Token,Token>(
        new RuleBodyParser(),new TokenParser(Token.Type.OB),new TokenParser(Token.Type.CB)).parse(st);
View Full Code Here

Examples of fasp.parser.tokenizer.SymbolToken

      naf = true;
      Token negOpTok = st.getNext();
      if(!negOpTok.getType().equals(Token.Type.SYMBOL))
        throw new ParseException(negOpTok.getLocation(),"naf operator",negOpTok.toString());

      SymbolToken negOpSym = (SymbolToken)negOpTok;

      if(!NEGATIONOPERATORS.containsKey(negOpSym.getSymbol()))
        throw new ParseException(st,unsupportedNegationOp(),negOpSym.getSymbol());

      negOp = NEGATIONOPERATORS.get(negOpSym.getSymbol());
    }
    if(negSym.tryParse(st))
      neg = true;
    try {
      NonGroundPredicate p = new PredicateParser().parse(st);
View Full Code Here

Examples of fasp.parser.tokenizer.SymbolToken

  @Override
  public FaspConstant 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.isLowerCase(sym.getSymbol().charAt(0))) {
          st.eat();
          return new FaspConstant(sym.getSymbol());
        } else {
          throw new ParseException(st,"constant","variable");
        }
      } else {
        throw new ParseException(st,"constant",st.lookahead().toString());
View Full Code Here

Examples of fasp.parser.tokenizer.SymbolToken

  @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 {
          throw new ParseException(st,"variable","constant");
        }
      } else {
        throw new ParseException(st,"variable",st.lookahead().toString());
View Full Code Here

Examples of org.apache.ctakes.core.fsm.token.SymbolToken

   * Called to check if the conditional meets the criteria defined by this
   * state.
   */
  public boolean satisfiedBy(Object conditional) {
    if (conditional instanceof SymbolToken) {
      SymbolToken t = (SymbolToken) conditional;
      if (t.getChar() == iv_symbolChar) {
        return true;
      }
    }

    return false;
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.SymbolToken

        } else if (oldSystemTokenClass.equals(PunctuationToken.class.getName()))
        {
          newGoldToken = new PunctuationToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(SymbolToken.class.getName()))
        {
          newGoldToken = new SymbolToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(BaseToken.class.getName()))
        {
          newGoldToken = new BaseToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else
        {
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.SymbolToken

      return new NewlineTokenAdapter(nta);
    } else if (obj instanceof ContractionToken) {
      ContractionToken cta = (ContractionToken) obj;
      return new ContractionTokenAdapter(cta);
    } else if (obj instanceof SymbolToken) {
      SymbolToken sta = (SymbolToken) obj;
      return new SymbolTokenAdapter(sta);
    }

    throw new Exception("No Context Dependent Tokenizer adapter for class: " + obj.getClass());
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.SymbolToken

    {
      ContractionToken cta = (ContractionToken) obj;
      return new ContractionTokenAdapter(cta);
    } else if (obj instanceof SymbolToken)
    {
      SymbolToken sta = (SymbolToken) obj;
      return new SymbolTokenAdapter(sta);
    }

    throw new Exception("No CDT adapter for class: " + obj.getClass());
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.SymbolToken

    }

      } else if (clas.equals(SymbolToken.class)) {

    if (jcas!=null)
        token = new SymbolToken(jcas, beginFromStartOfDocument, endFromStartOfDocument);
    else {
        token = new Token(beginFromStartOfDocument, endFromStartOfDocument);
        ((Token)token).setText(s.substring(begin, end));
    }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.SymbolToken

        } else if (oldSystemTokenClass.equals(PunctuationToken.class.getName()))
        {
          newGoldToken = new PunctuationToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(SymbolToken.class.getName()))
        {
          newGoldToken = new SymbolToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else if (oldSystemTokenClass.equals(BaseToken.class.getName()))
        {
          newGoldToken = new BaseToken(goldView, oldSystemToken.getBegin(), oldSystemToken.getEnd());
        } else
        {
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.