public ExportWithUnits() { SelectedExportedUnit = ConversionUnit.Feet; SelectedExportedUnitsSource = Conversions.ConversionMetricLookup[ConversionMetricUnit.Length]; AssociativeNode geometryNode = new ArrayNode(); AssociativeNode stringNode = new StringNode(); InPortData.Add(new PortData("geometry", Resources.ExportToSatGeometryInputDescription, geometryNode)); InPortData.Add(new PortData("filePath", Resources.ExportToSatFilePathDescription, stringNode)); OutPortData.Add(new PortData("string", Resources.ExportToSatFilePathOutputDescription)); ShouldDisplayPreviewCore = true; RegisterAllPorts(); }
private AssociativeNode ContextDataMethodCallNode(IContextData data) { string appname = data.ContextProvider.Name; string connectionstring = data.Name; string varname = data.Name; // //Build a functioncall node for expression varname = ImportData(appname, connectionstring); var func = new ProtoCore.AST.AssociativeAST.IdentifierNode(); func.Value = func.Name = ProtoCore.DSASM.Constants.kImportData; var paramAppName = new ProtoCore.AST.AssociativeAST.StringNode(); paramAppName.Value = appname; var paramConnectionString = new ProtoCore.AST.AssociativeAST.StringNode(); paramConnectionString.Value = connectionstring; var funcCall = new ProtoCore.AST.AssociativeAST.FunctionCallNode(); funcCall.Function = func; funcCall.Name = ProtoCore.DSASM.Constants.kImportData; funcCall.FormalArguments.Add(paramAppName); funcCall.FormalArguments.Add(paramConnectionString); var var = new ProtoCore.AST.AssociativeAST.IdentifierNode(); var.Name = var.Value = varname; var assignExpr = new ProtoCore.AST.AssociativeAST.BinaryExpressionNode(); assignExpr.LeftNode = var; assignExpr.Optr = ProtoCore.DSASM.Operator.assign; assignExpr.RightNode = funcCall; return(assignExpr); }
private AssociativeNode ContextDataMethodCallNode(IContextData data) { string appname = data.ContextProvider.Name; string connectionstring = data.Name; string varname = data.Name; // //Build a functioncall node for expression varname = ImportData(appname, connectionstring); var func = new ProtoCore.AST.AssociativeAST.IdentifierNode(); func.Value = func.Name = ProtoCore.DSASM.Constants.kImportData; var paramAppName = new ProtoCore.AST.AssociativeAST.StringNode(); paramAppName.value = appname; var paramConnectionString = new ProtoCore.AST.AssociativeAST.StringNode(); paramConnectionString.value = connectionstring; var funcCall = new ProtoCore.AST.AssociativeAST.FunctionCallNode(); funcCall.Function = func; funcCall.Name = ProtoCore.DSASM.Constants.kImportData; funcCall.FormalArguments.Add(paramAppName); funcCall.FormalArguments.Add(paramConnectionString); var var = new ProtoCore.AST.AssociativeAST.IdentifierNode(); var.Name = var.Value = varname; var assignExpr = new ProtoCore.AST.AssociativeAST.BinaryExpressionNode(); assignExpr.LeftNode = var; assignExpr.Optr = ProtoCore.DSASM.Operator.assign; assignExpr.RightNode = funcCall; return assignExpr; }
void Associative_String(out ProtoCore.AST.AssociativeAST.AssociativeNode node) { node = null; Expect(4); node = new ProtoCore.AST.AssociativeAST.StringNode() { Value = GetEscapedString(t.val.Length <= 2 ? "" : t.val.Substring(1, t.val.Length - 2)), }; NodeUtils.SetNodeLocation(node, t); }
void Associative_String(out ProtoCore.AST.AssociativeAST.AssociativeNode node) { node = null; Expect(4); node = new ProtoCore.AST.AssociativeAST.StringNode() { value = GetEscapedString(t.val.Length <= 2 ? "" : t.val.Substring(1, t.val.Length - 2)), line = t.line, col = t.col }; }
public void TestTypeSwitch() { object v = null; object node = null; DoubleNode doubleNode = new DoubleNode(1.2); node = doubleNode; TypeSwitch.Do( node, TypeSwitch.Case<IntNode>(n => v = n.Value), TypeSwitch.Case<DoubleNode>(n => v = n.Value), TypeSwitch.Case<BooleanNode>(n => v = n.Value), TypeSwitch.Case<StringNode>(n => v = n.Value), TypeSwitch.Default(() => v = null)); Assert.AreEqual(v, 1.2); IntNode intNode = new IntNode(42); node = intNode; TypeSwitch.Do( node, TypeSwitch.Case<IntNode>(n => v = n.Value), TypeSwitch.Case<DoubleNode>(n => v = n.Value), TypeSwitch.Case<BooleanNode>(n => v = n.Value), TypeSwitch.Case<StringNode>(n => v = n.Value), TypeSwitch.Default(() => v = null)); Assert.AreEqual(v, 42); StringNode sNode = new StringNode(); node = sNode; TypeSwitch.Do( node, TypeSwitch.Case<IntNode>(n => v = n.Value), TypeSwitch.Case<DoubleNode>(n => v = n.Value), TypeSwitch.Case<BooleanNode>(n => v = n.Value), TypeSwitch.Default(() => v = 24)); Assert.AreEqual(v, 24); }
public StringNode(StringNode rhs) : base(rhs) { value = rhs.value; }