Advertisement
code_gs

Untitled

Mar 5th, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. _Key_
  2.  
  3. // Comment
  4. /* Comment */
  5. TypeName {Type KeyName, ...} = typedef
  6. ChildType : ParentType {...} = typedef with inheritence (always public)
  7. public = exported object/variable. Rest are "virtual"/confined to this document
  8. type(Var) references the type pointed to by the value of Var. Var must be a StringID
  9.  
  10. type[#] = array of type with optional length #
  11. uint<#> = #-bit uint
  12. int[min, max] = int bounded between min and max. Standard interval notation used
  13. UTF8 = UTF8Char[]
  14. ASCII = ASCIIChar[]
  15.  
  16. StringID<DBType, # = 64> = uint<#> index to a DBType entry in the future, case-insensitive ASCII for now
  17.  
  18. ObjectRef {StringID Object}
  19. MonoMediaObject : ObjectRef {StringID MediaType}
  20.  
  21. Rank = int[0, 2]
  22. RankedObject : ObjectRef {Rank Rank}
  23. RankedOriginObject : RankedObject {Bool Originating}
  24.  
  25. ExternalIDList<source = StringID> {[source]: ASCII, ...}
  26. AuthorID {StringID Source, ASCII IDs}
  27. LangStrings<content = UTF8, lang = StringID> {[lang]: content, ...}
  28. OR LangStrings<content = UTF8, _> = content - if user passes a language to the url
  29. RankedLangStrings : LangStrings {Rank Rank}
  30. AuthoredLangStrings<append = {}> : LangStrings<{AuthorID[] Authors, UTF8 Content} + append> {}
  31. // Experimental: Subsections can be under multiple parent sections
  32. // The uint is the index of the parent in the greater SectionLangString array
  33. SectionLangStrings : AuthoredLangStrings<{UTF8 Title}> {uint[] Parents}
  34.  
  35. ------------------------------------------------------------------------------
  36.  
  37. DBObject : Object
  38. {
  39. $StringID<Object> ObjectType, // Object type
  40. $StringID<type(ObjectType)> ID // Object ID, relative to the object type
  41. }
  42.  
  43. PageObject : DBObject
  44. {
  45. LangStrings Name,
  46. // TODO: Should multiple translations be supported?
  47. RankedLangStrings AlternateNames,
  48. AuthoredLangStrings Intro,
  49. SectionLangStrings[] Sections,
  50. StringID<Source>[] ExternalIDs
  51. }
  52.  
  53. Source : PageObject
  54. {
  55. ASCII[] BaseDomains,
  56. // TODO: fetching rules
  57. }
  58.  
  59. /* Category objects */
  60.  
  61. CategoryObject : DBObject
  62. {}
  63.  
  64. public Sense : CategoryObject // Sight, Hearing, Taste
  65. {}
  66.  
  67. public VirtualSense : CategoryObject // Language, Music Comprehension
  68. {
  69. StringID[] PerceptibleSenses
  70. }
  71.  
  72. public Descriptor : SensoryObject
  73. {
  74. StringID ObjectType = "descriptor"
  75.  
  76. StringID DescriptorType,
  77. // TODO: Should these be ranked?
  78. StringID[] ParentDescriptors
  79. }
  80.  
  81. CulturalObject : CategoryObject
  82. {
  83. RankedOriginObject[] Locations, // ORIGINATING?
  84. RankedOriginObject[] Cultures // ORIGINATING?
  85. }
  86.  
  87. public Division : CategoryObject
  88. {
  89. StringID ObjectType = "division"
  90.  
  91. StringID[] ParentDivisions
  92. }
  93.  
  94. public Movement : CulturalObject
  95. {
  96. StringID ObjectType = "movement"
  97.  
  98. RankedObject[] InfluencingMovements // No inheritence on any RankedObject
  99. }
  100.  
  101. public Scene : CulturalObject, MonoMediaObject
  102. {
  103. StringID ObjectType = "scene"
  104.  
  105. // Experimental: Make scenes context free. Noise Rock bands could be part
  106. // of a Noise scene. Non-Punk Rock bands are part of NYHC. Let how scenes
  107. // are tagged on releases reflect its genres/movements
  108. RankedObject[] InfluencingScenes
  109. }
  110.  
  111. public Meta : Division, MonoMediaObject
  112. {
  113. StringID ObjectType = "meta"
  114.  
  115. StringID[] ParentMetas
  116. }
  117.  
  118. public Style : Meta, Movement
  119. {
  120. StringID ObjectType = "style"
  121.  
  122. StringID[] ParentStyles,
  123. RankedObject[] HistoricalInfluencingStyles,
  124. RankedObject[] SonicInfluencingStyles
  125. }
  126.  
  127. public Trend : Style
  128. {
  129. StringID ObjectType = "trend"
  130.  
  131. RankedObject[] InfluencingTrends
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement