Ejemplo n.º 1
0
        public StatementSyntax TranslateProperty(
            string ctrlType,
            string ctrlIdentifier,
            VisualBasic6Parser.Cp_SinglePropertyContext property
            )
        {
            var propertyName =
                vb6NodeTree
                .GetChildren(property)
                .Find(x => x is VisualBasic6Parser.ImplicitCallStmt_InStmtContext)
                .getText()
                .Trim();
            var propertyValueContext =
                vb6NodeTree
                .GetChildren(property)
                .Find(x => x is VisualBasic6Parser.Cp_PropertyValueContext);
            var literalContext =
                vb6NodeTree
                .GetChildren(propertyValueContext)
                .Find(x => x is VisualBasic6Parser.LiteralContext);

            var asg = (LiteralImpl)_compileResult.Program.getASGElementRegistry().getASGElement(literalContext);

            if (asg == null)
            {
                DebugClass.LogError("ASG missing for: " + ctrlIdentifier + " for property: " + propertyName);
                throw new System.NotImplementedException("Don't know how to handle ASG null.");
            }

            var valueNode = TranslatorForExpression.GetExpression(asg);

            var valueString = valueNode.NormalizeWhitespace().ToFullString();

            var translatedPropertyName = TranslatePropertyName(ctrlType, propertyName);

            return(SyntaxFactory.ParseStatement(ctrlIdentifier + "." + translatedPropertyName + " = " + valueString + ";"));
        }
Ejemplo n.º 2
0
 public override object VisitCp_SingleProperty([NotNull] VisualBasic6Parser.Cp_SinglePropertyContext context)
 {
     return(base.VisitCp_SingleProperty(context));
 }
Ejemplo n.º 3
0
 public override void ExitCp_SingleProperty([NotNull] VisualBasic6Parser.Cp_SinglePropertyContext context)
 {
 }