public string Visit(AstConstant item)
        {
            var composer = CreateColumnsComposer();

            composer
            .AppendToColumns("Constant Name:", item.AccessName);

            return composer.GenerateText();
        }
Beispiel #2
0
 private void GenerateConstantCode(AstConstant constantInfo)
 {
     ActiveFileTextComposer.AppendAtNewLine("public static readonly ");
     GenerateTypeName(constantInfo.GMacType);
     ActiveFileTextComposer.Append(" ");
     ActiveFileTextComposer.Append(constantInfo.Name);
     ActiveFileTextComposer.Append(" = ");
     GenerateValueCode(constantInfo.Value);
     ActiveFileTextComposer.AppendLine(";");
     ActiveFileTextComposer.AppendLine();
 }
Beispiel #3
0
        public TreeNode Visit(AstConstant item)
        {
            var node = new TreeNode(item.Name)
            {
                Tag              = item,
                ImageKey         = @"Constant64.png",
                SelectedImageKey = @"Constant64.png"
            };

            return(node);
        }
Beispiel #4
0
        /// <summary>
        /// Find a constant given a text reference starting at the current scope information
        /// </summary>
        /// <param name="symbolName"></param>
        /// <returns></returns>
        public AstConstant Constant(string symbolName)
        {
            symbolName = symbolName.Trim();

            AstConstant symbolInfo;

            LanguageSymbol symbol;

            if (_symbolsCache.TryGetValue(symbolName, out symbol))
            {
                symbolInfo = new AstConstant(symbol as GMacConstant);
            }
            else
            {
                symbolInfo = _expressionCompiler.GetConstant(symbolName);

                AddToSymbolsCache(symbolName, symbolInfo.AssociatedConstant);
            }

            this.ReportNormal("Request Constant " + symbolName.DoubleQuote(), symbolInfo.IsNotNullAndValid());

            return(symbolInfo);
        }
        public static TrsConstant Convert(this AstConstant astIn)
        {
            var token = astIn.AtomName;

            return(new TrsConstant(token.TokenString, astIn));
        }
 public string Visit(AstConstant constant)
 {
     return(RenderLiteral(constant.Value));
 }
 public object Visit(AstConstant constant)
 {
     return(constant.Value);
 }
 public Expression Visit(AstConstant constant)
 {
     return(Expression.Constant(constant.Value, typeof(object)));
 }
Beispiel #9
0
 public TrsConstant(string value, AstConstant source)
 {
     Value     = value;
     AstSource = source;
 }
 public virtual T Visit(AstConstant constant)
 {
     return(Default(constant));
 }