public void Add(OPERATOR_DECL op) { int n = this.operators.Length; int i = this.length++; if (i == n) { OPERATOR_DECL[] new_operators = new OPERATOR_DECL[n + 8]; for (int j = 0; j < n; j++) { new_operators[j] = operators[j]; } this.operators = new_operators; } this.operators[i] = op; }
public DECLARATION find(Identifier name, bool excludeImportSpace) { if (name.Name.Length == 0) { return(null); // Fix: find out why this happens } DECLARATION result = null; for (int i = 0, n = Length; i < n; i++) { Identifier decl_name = declarations[i].name; if (decl_name == null) { continue; } if (excludeImportSpace && declarations[i] is IMPORTSPACE_DECL) { continue; } if (excludeImportSpace && declarations[i] is IMPORT_DECL) { continue; } if (declarations[i] is OPERATOR_DECL) //Separate case in case of looking for an operator by its code //TODO: Replace the code by its synonym before the search { OPERATOR_DECL opertator = declarations[i] as OPERATOR_DECL; if (opertator.code.CompareTo(name.Name) == 0) { result = declarations[i]; break; } } if (decl_name.Name == name.Name) { result = declarations[i]; break; } } return(result); }
protected override void Visit_OPERATOR_DECL(OPERATOR_DECL node) { /* MOVE CODE HERE */ }
protected virtual void Visit_OPERATOR_DECL(OPERATOR_DECL node) { }