Package com.intellij.psi

Examples of com.intellij.psi.PsiElement.accept()


  @Override
  public void visitCondition(Condition condition) {
    PsiElement firstChild = condition.getFirstChild();
    if (firstChild != null) {
      firstChild.accept(this);
    }
  }

  @Override
  public void visitFunctionCall(FunctionCall functionCall) {
View Full Code Here


      final PsiElement head = functionCall.getHead();
      if (head instanceof Symbol) {
        myUnboundSymbols.add((Symbol) head);
      } else {
        // situations like this a[p:b, c, d] ^:= ... where the patterns or something else is involved.
        head.accept(this);
      }
    }
  }

  /**
 
View Full Code Here

   */
  @Override
  public void visitPattern(final Pattern pattern) {
    final PsiElement lastChild = pattern.getLastChild();
    if (lastChild != null) {
      lastChild.accept(this);
    }
  }

  @Override
  public void visitGroup(Group group) {
View Full Code Here

  @Override
  public void visitCondition(Condition condition) {
    PsiElement firstChild = condition.getFirstChild();
    if (firstChild != null) {
      firstChild.accept(this);
    }
  }

  private void setMyAssignmentType(final String head) {
    if (ourHeadAssignmentMapping.containsKey(head)) {
View Full Code Here

      // The next set are symbols that are just ignored and we have to check their first argument for a symbol
      // which is defined
      if (functionCall.matchesHead("HoldPattern|Longest|Shortest|Repeated")) {
        final PsiElement arg1 = functionCall.getArgument(1);
        if (arg1 != null) {
          arg1.accept(this);
        }
      }
      // check if we have an assignment of the form Options[sym] = {...}
      if (functionCall.equals(myStartElement) && functionCall.matchesHead("Options|Attributes|MessageName|Default|Format|N|SyntaxInformation")) {
        if (myFoundAssignmentType) {
View Full Code Here

          if (functionCall.matchesHead("Options|Attributes|MessageName|Default|SyntaxInformation")) {
            if (arg1 instanceof Symbol) myUnboundSymbols.add((Symbol) arg1);
          } else {
            //if we have for instance  N[e : poly[cp_], pa_] := ... where the argument itself can be a complicated
            // patter, then we just go on with the visitor, but we remember that we already know the assignment type
            arg1.accept(this);
          }
        }
      } else {
        myUnboundSymbols.add((Symbol) head);
      }
View Full Code Here

   */
  @Override
  public void visitPattern(final Pattern pattern) {
    final PsiElement lastChild = pattern.getLastChild();
    if (lastChild != null) {
      lastChild.accept(this);
    }
  }

  @Override
  public void visitMessageName(final MessageName messageName) {
View Full Code Here

    @Override
    public void visitSetDelayed(final SetDelayed setDelayed) {
      final PsiElement lhs = setDelayed.getFirstChild();
      SetDefinitionSymbolVisitor visitor = new SetDefinitionSymbolVisitor(lhs, SET_DELAYED_ASSIGNMENT);
      lhs.accept(visitor);
      final java.util.Set<Symbol> unboundSymbols = visitor.getUnboundSymbols();
      for (Symbol symbol : unboundSymbols) {
        addAssignment(symbol, lhs, visitor.getAssignmentType());
      }
    }
View Full Code Here

    @Override
    public void visitSet(final Set set) {
      final PsiElement lhs = set.getFirstChild();
      SetDefinitionSymbolVisitor visitor = new SetDefinitionSymbolVisitor(lhs, SET_ASSIGNMENT);
      lhs.accept(visitor);
      final java.util.Set<Symbol> unboundSymbols = visitor.getUnboundSymbols();
      for (Symbol symbol : unboundSymbols) {
        PsiElement context = lhs;
        if (visitor.getAssignmentType() == ATTRIBUTES_ASSIGNMENT || visitor.getAssignmentType() == OPTIONS_ASSIGNMENT) {
          context = set.getLastChild();
View Full Code Here

    @Override
    public void visitUpSet(final UpSet upSet) {
      final PsiElement lhs = upSet.getFirstChild();
      if (lhs != null) {
        UpSetDefinitionSymbolVisitor visitor = new UpSetDefinitionSymbolVisitor();
        lhs.accept(visitor);
        final java.util.Set<Symbol> unboundSymbols = visitor.getUnboundSymbols();
        for (Symbol symbol : unboundSymbols) {
          addAssignment(symbol, lhs, UP_SET_ASSIGNMENT);
        }
      }
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.