public LexerScope NewScope(ILexerableNode node) { Guid guid = Guid.NewGuid(); LexerScope lexerScope = new LexerScope(node, this, guid); Scopes.Add(node, lexerScope); ScopeLookup.Add(guid, lexerScope); return(lexerScope); }
public LexerScope GetScope(Lexer lexer, LexerScope scope) { int targetPort = 0; // var scope = lexer.NewScope(this); scope.AddOperation(new Op_I32_Add()); if (InputPropertyPorts[targetPort].Connectors.Count > 0 && InputPropertyPorts[targetPort]?.Connectors[0]?.StartPort?.Owner != null && InputPropertyPorts[targetPort]?.Connectors[0]?.StartPort?.Owner is CNodeBase) { // Pass reference scope.AddOperation(new Ref_NodePort(InputPropertyPorts[0].Connectors[0].StartPort)); } else { // Get data scope.AddOperation(new Const_I32 { Constant = (int)PortLHS.Value }); } targetPort = 1; if (InputPropertyPorts[targetPort].Connectors.Count > 0 && InputPropertyPorts[targetPort]?.Connectors[0]?.StartPort?.Owner != null && InputPropertyPorts[targetPort]?.Connectors[0]?.StartPort?.Owner is CNodeBase) { // Pass reference scope.AddOperation(new Ref_NodePort(InputPropertyPorts[0].Connectors[0].StartPort)); } else { // Get data scope.AddOperation(new Const_I32 { Constant = (int)PortLHS.Value }); } scope.AddOperation(new Ret_I32 { }); return(scope); }