public DMASTProcStatementForRange(DMASTProcStatement initializer, DMASTIdentifier variable, DMASTExpression rangeStart, DMASTExpression rangeEnd, DMASTExpression step, DMASTProcBlockInner body) : base(initializer, body) { Variable = variable; RangeStart = rangeStart; RangeEnd = rangeEnd; Step = step; }
public void VisitIdentifier(DMASTIdentifier identifier) { var name = identifier.Identifier; switch (name) { case "src": Result = new Expressions.Src(identifier.Location, _dmObject.Path); break; case "usr": Result = new Expressions.Usr(identifier.Location); break; case "args": Result = new Expressions.Args(identifier.Location); break; default: { DMProc.LocalVariable localVar = _proc?.GetLocalVariable(name); if (localVar != null && _scopeMode == "normal") { Result = new Expressions.Local(identifier.Location, localVar); return; } int?procGlobalId = _proc?.GetGlobalVariableId(name); if (procGlobalId != null) { Result = new Expressions.GlobalField(identifier.Location, DMObjectTree.Globals[procGlobalId.Value].Type, procGlobalId.Value); return; } var field = _dmObject?.GetVariable(name); if (field != null && _scopeMode == "normal") { Result = new Expressions.Field(identifier.Location, field); return; } int?globalId = _dmObject?.GetGlobalVariableId(name); if (globalId != null) { Result = new Expressions.GlobalField(identifier.Location, DMObjectTree.Globals[globalId.Value].Type, globalId.Value); return; } throw new CompileErrorException(identifier.Location, $"Unknown identifier \"{name}\""); } } }
public DMASTProcStatementForList(DMASTProcStatement initializer, DMASTIdentifier variable, DMASTExpression list, DMASTProcBlockInner body) : base(initializer, body) { Variable = variable; List = list; }
public DMASTProcStatementGoto(DMASTIdentifier label) { Label = label; }
public DMASTNewIdentifier(DMASTIdentifier identifier, DMASTCallParameter[] parameters) { Identifier = identifier; Parameters = parameters; }