Package org.woped.metrics.formalGrammar

Examples of org.woped.metrics.formalGrammar.metricsGrammarParser.evaluator()


      CharStream stream = new ANTLRStringStream(formula);
      metricsGrammarLexer lexer = new metricsGrammarLexer(stream);
      TokenStream tokenStream = new CommonTokenStream(lexer);
      metricsGrammarParser parser = new metricsGrammarParser(tokenStream,
          mc, stack, doNotDisplay, syntaxCheck);
      return parser.evaluator();
    } catch (RecognitionException re) {
      //This Exception will only be thrown if there is a general Error like a letter which is not allowed
      return caughtRecognitionException(re, formula, mc, stack,
          doNotDisplay, syntaxCheck);
    } catch (FormulaVariableNotFoundException fvnfe) {
View Full Code Here


    metricsGrammarLexer lexer = new metricsGrammarLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    metricsGrammarParser parser = new metricsGrammarParser(tokenStream, mc,
        stack, doNotDisplay, syntaxCheck);
    try {
      double value = parser.evaluator();
      // The new Formula worked well. The user should be informed
      // that he should chance the formula. Therefore we throw a EnhancementException.
      // We have to find the ID of the formula
      throw new EnhancementException(formula, value);
    } catch (RecognitionException e2) {
View Full Code Here

    metricsGrammarLexer lexer = new metricsGrammarLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    metricsGrammarParser parser = new metricsGrammarParser(tokenStream, mc,
        stack, doNotDisplay, syntaxCheck);
    try {
      double value = parser.evaluator();
      // The new Formula worked well. The user should be informed
      // that he should chance the formula. Therefore we throw a EnhancementException.
      // We have to find the ID of the formula
      throw new EnhancementException(formula, value);
    } catch (FormulaVariableNotFoundException fvnfe) {
View Full Code Here

    metricsGrammarLexer lexer = new metricsGrammarLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    metricsGrammarParser parser = new metricsGrammarParser(tokenStream, mc,
        stack, doNotDisplay, syntaxCheck);
    try {
      parser.evaluator();
    }catch(NestedCalculateFormulaException ncfe2){
      ArrayList<FormulaVariableNotFoundException> newList = ncfe2.getFormulaVariableNotFoundExceptions();
      for(FormulaVariableNotFoundException fvnfe: newList){
        String variable = fvnfe.getVariable();
        if(variablelist.containsKey(variable)){
View Full Code Here

    metricsGrammarLexer lexer = new metricsGrammarLexer(stream);
    TokenStream tokenStream = new CommonTokenStream(lexer);
    metricsGrammarParser parser = new metricsGrammarParser(tokenStream, mc,
        stack, doNotDisplay, syntaxCheck);
    try {
      parser.evaluator();
    } catch (NestedCalculateFormulaException ncfe) {

      ArrayList<MismatchedTokenException> oldList = ncfe
          .getMismatchedTokenExceptions();
      ArrayList<String> missingChar = new ArrayList<String>();
View Full Code Here

        metricsGrammarLexer lexer2 = new metricsGrammarLexer(stream2);
        TokenStream tokenStream2 = new CommonTokenStream(lexer2);
        metricsGrammarParser parser2 = new metricsGrammarParser(
            tokenStream2, mc, stack, doNotDisplay, syntaxCheck);
        try {
          parser2.evaluator();
          oldList.clear();
        } catch (NestedCalculateFormulaException ncfe2) {
          oldList = ncfe2  .getMismatchedTokenExceptions();
        } catch (Exception e) {
          throw ncfeOriginal;
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.