Package org.rascalmpl.interpreter.matching

Examples of org.rascalmpl.interpreter.matching.QualifiedNamePattern


      Result<IValue> r = eval.getEvaluator().getCurrentEnvt().getSimpleVariable(name);

      if (r != null) {
        if (r.getValue() != null) {
          // Previously declared and initialized variable
          return new QualifiedNamePattern(eval, this, name);
        }

        Type type = r.getType();
        if (type instanceof NonTerminalType) {
          NonTerminalType cType = (NonTerminalType) type;
          if (cType.isConcreteListType()) {
            return new ConcreteListVariablePattern(eval, this, type, ((Default) name).lastName());
          }
        }

        return new QualifiedNamePattern(eval, this, name);
      }

      // TODO: I don't understand which feature this code implements
//      if (eval.getCurrentEnvt().isTreeConstructorName(name, signature)) {
//        return new NodePattern(eval, this, null, name, new ArrayList<IMatchingResult>());
//      }

      // Completely fresh variable
      return new QualifiedNamePattern(eval, this, name);
      // return new AbstractPatternTypedVariable(vf, env,
      // ev.tf.valueType(), name);

    }
View Full Code Here


    @Override
    public IMatchingResult buildMatcher(IEvaluatorContext eval) {
      IMatchingResult pat = this.getPattern().buildMatcher(eval);
      LinkedList<Name> names = new LinkedList<Name>();
      names.add(this.getName());
      IMatchingResult var = new QualifiedNamePattern(eval, this, ASTBuilder.<org.rascalmpl.ast.QualifiedName> make("QualifiedName", "Default", this.getLocation(), names));
      return new VariableBecomesPattern(eval, this, var, pat);

    }
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.matching.QualifiedNamePattern

Copyright © 2018 www.massapicom. 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.