Example #1
0
  public void setIdentifier(TIdentifier node) {
    if (_identifier_ != null) {
      _identifier_.parent(null);
    }

    if (node != null) {
      if (node.parent() != null) {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    _identifier_ = node;
  }
  public void setRight(TIdentifier node) {
    if (_right_ != null) {
      _right_.parent(null);
    }

    if (node != null) {
      if (node.parent() != null) {
        node.parent().removeChild(node);
      }

      node.parent(this);
    }

    _right_ = node;
  }
Example #3
0
  void addContext(AParserContext node) {

    if (node == null) {
      throw new InternalException("node may not be null");
    }

    TIdentifier nameToken = node.getName();
    String name = nameToken == null ? null : nameToken.getText();
    Context context = this.nameToContextMap.get(name);

    if (context == null) {
      context = new Context(this.globalIndex, name);
      this.nameToContextMap.put(name, context);
      this.contexts.add(context);
    }

    this.nodeToContextMap.put(node, context);
    context.setDeclaration(node);
  }
Example #4
0
  public Macro getMacro(TIdentifier identifier) {

    if (identifier == null) {
      throw new InternalException("identifier may not be null");
    }

    String name = identifier.getText();

    if (this.macroMap.containsKey(name)) {
      return this.macroMap.get(name);
    }

    if (this.parent != null) {
      return this.parent.getMacro(identifier);
    }

    return getGlobalIndex().getTopMacro(identifier);
  }