public NamespaceDefinitionToken(HlNamespace ns, IHlToken[] subtokens, int start) : base( HlTokenType.OpNamespaceDefinition, subtokens, start ) { Namespace = ns; }
public HlFunctionDefinition( HlTypeSystem ts, HlNamespace root, string name, IHlToken[] mods) : base(name, mods) { ReturnType = ts.GetType(root, HLBaseTypeNames.s_UintTypeName); }
public CStringTypeDefinition(HlNamespace ns) : base( ns, HLBaseTypeNames.s_CStringTypeName, true, false, false ) { }
public HlTypeDefinition(HlNamespace ns, string name, bool isPublic, bool isAbstract, bool isValueType) { Namespace = ns; IsValueType = isValueType; IsPublic = isPublic; IsAbstract = isAbstract; Name = name; m_BaseTypes = new List <IHlToken>(); }
public FloatTypeDefinition(HlNamespace root) : base( root, HLBaseTypeNames.s_FloatTypeName, true, false, true ) { }
public HlTypeDefinition GetType(HlNamespace caller, string name) { if (!m_DefinedTypes.Any(x => x.Name == name && x.Namespace.IsVisibleTo(caller))) { EventManager <ErrorEvent> .SendEvent(new TypeNotFoundEvent( name )); } return(m_DefinedTypes.First(x => x.Name == name && x.Namespace.IsVisibleTo(caller))); }
public StringTypeDefinition(HlNamespace root) : base( root, HLBaseTypeNames.s_StringTypeName, true, false, false ) { }
public void Import(HlNamespace caller, HlTypeSystem other) { foreach (HlTypeDefinition otherDef in other) { if (otherDef.IsPublic && !HasType(caller, otherDef.Name)) { AddItem(otherDef); } } }
public ArrayTypeDefintion(HlNamespace root, HlTypeDefinition elementType, uint size) : base( root, elementType.Name + "[]", true, false, false ) { Size = size; ElementType = elementType; }
public static HlTypeSystem Create(HlNamespace root) { HlTypeSystem ret = new HlTypeSystem(); ret.AddItem(new UIntTypeDefinition(root)); ret.AddItem(new FloatTypeDefinition(root)); ret.AddItem(new StringTypeDefinition(root)); ret.AddItem(new CStringTypeDefinition(root)); ret.AddItem(new HlTypeDefinition(root, "void", false, true, true)); return(ret); }
public HlExternalFunctionDefinition( HlTypeSystem ts, HlNamespace root, string name, string translated, List <IHlToken> mods) : base( ts, root, name, mods.ToArray() ) { TranslatedFunctionName = translated; }
public HlTypeDefinition CreateEmptyType( HlNamespace ns, string name, bool isPublic, bool isAbstract, bool isValueType) { if (m_DefinedTypes.Any(x => x.Name == name)) { EventManager <ErrorEvent> .SendEvent(new HlTypeRedefinitionEvent( name )); return(null); } HlTypeDefinition def = new HlTypeDefinition(ns, name, isPublic, isAbstract, isValueType); AddItem(def); return(def); }
public bool HasType(HlNamespace caller, string name) { return(m_DefinedTypes.Any(x => x.Name == name && x.Namespace.IsVisibleTo(caller))); }