Beispiel #1
0
        public FieldMetadata AddField(String name, TSType fieldType)
        {
            var fm = new FieldMetadata(name, fieldType);

            Add(name, fm);
            return(fm);
        }
Beispiel #2
0
 public void AddDeclare(String name, TSType type)
 {
     if (_declares == null)
     {
         _declares = new Dictionary <String, TSType>();
     }
     _declares.Add(name, type);
 }
Beispiel #3
0
        public TypeMetadata AddType(String name, TSType baseType)
        {
            if (ContainsKey(name))
            {
                throw new TSParserException($"Type '{name}' is already defined");
            }
            var tm = new TypeMetadata();

            Add(name, tm);
            return(tm);
        }
Beispiel #4
0
        void ReadInterface()
        {
            var name = _tok.Token.Value;

            Next();
            TSType type = null;

            if (_tok.IsIderValue("extends"))
            {
                Next();
                type = ReadType();
            }
            var tm = _mm.AddType(name, type);

            ReadLeftCurly();
            ReadProps(tm);
            if (!_tok.IsRightCurly)             // not read,check only
            {
                throw new TSParserException("Expected '}'");
            }
        }
Beispiel #5
0
 public FieldMetadata(String name, TSType type)
 {
     Name = name;
     Type = type;
 }