Exemple #1
0
 public void Visit(DatatypeNode dt)
 {
     if (dt.ModificationLex != null)
     {
         ApplyForegroundValue(dt.ModificationLex, KeywordBrush);
     }
     ApplyForegroundValue(dt.TypeLex,
                          syntax.AllKeys.Is(dt.TypeLex.Value) ?
                          KeywordBrush : NewKeywordsNameBrush);
 }
Exemple #2
0
        TypeNode TypeParse(Queue <LexerNode> lexers)
        {
            TypeNode typen = new DatatypeNode();

            var lex = lexers.Dequeue();

            if (syntax.Modifications.Is(lex.Value))
            {
                typen.ModificationLex = lex;
                lex = lexers.Dequeue();
            }

            if (syntax.Array.Contains(lex.Value))
            {
                typen = new ArrayType {
                    ModificationLex = typen.ModificationLex
                };
            }
            else if (syntax.Primitive.Contains(lex.Value))
            {
                typen = new PrimitiveType {
                    ModificationLex = typen.ModificationLex
                };
            }
            else if (syntax.Generics.Is(lex.Value))
            {
                //seaching generic type T
                using (lexers.Boundary("<", ">")) {
                    var mod = typen.ModificationLex;
                    typen = new GenericTypeNode()
                    {
                        ModificationLex = mod,
                        TTypeLex        = lexers.Dequeue(),
                    };
                }
            }
            typen.TypeLex = lex;
            return(typen);
        }
Exemple #3
0
 public void Visit(DatatypeNode typeNode)
 {
 }