Updated AST_Types.md doc

This commit is contained in:
Edward R. Gonzalez 2023-11-22 15:03:24 -05:00
parent 91a3250d4c
commit 6b10cd2b3e
3 changed files with 186 additions and 164 deletions

View File

@ -21,7 +21,7 @@ Fields:
```cpp ```cpp
Code Front; Code Front;
Code Back; Code Back;
Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -52,6 +52,7 @@ Fields:
StringCached Content; StringCached Content;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -137,6 +138,7 @@ CodeParam Params;
Code Body; Code Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
CodeT Type; CodeT Type;
``` ```
@ -165,6 +167,7 @@ Fields:
StringCached Content; StringCached Content;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -186,6 +189,7 @@ CodeSpecifiers Specs;
Code Body; Code Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
CodeT Type; CodeT Type;
``` ```
@ -214,6 +218,7 @@ CodeType UnderlyingType;
CodeBody Body; CodeBody Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -244,6 +249,7 @@ Fields:
StringCached Content; StringCached Content;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -263,6 +269,7 @@ Fields:
CodeBody Body; CodeBody Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -286,6 +293,7 @@ StringCached Content;
Code Prev; Code Prev;
Code Next; Code Next;
Code Parent; Code Parent;
parser::Token* Tok;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
``` ```
@ -307,6 +315,7 @@ CodeComment InlineCmt;
Code Declaration; Code Declaration;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -330,8 +339,9 @@ CodeType ReturnType;
CodeParam Params; CodeParam Params;
CodeBody Body; CodeBody Body;
Code Prev; Code Prev;
Code Parent;
Code Next; Code Next;
parser::Token* Tok;
Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
ModuleFlag ModuleFlags; ModuleFlag ModuleFlags;
@ -357,6 +367,7 @@ Fields:
```cpp ```cpp
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -377,6 +388,7 @@ Fields:
CodeBody Body; CodeBody Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -405,6 +417,7 @@ CodeParam Params;
CodeBody Body; CodeBody Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -436,6 +449,7 @@ CodeType ValueType;
CodeBody Body; CodeBody Body;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -463,6 +477,7 @@ CodeType ValueType;
Code Value; Code Value;
CodeParam Last; CodeParam Last;
CodeParam Next; CodeParam Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -483,6 +498,7 @@ Fields:
StringCached Content; StringCached Content;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -502,6 +518,7 @@ Fields:
StringCached Content; StringCached Content;
Code Prev; Code Prev;
Code Next; Code Next;
paser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -519,8 +536,10 @@ Fields:
```cpp ```cpp
SpecifierT ArrSpecs[ AST::ArrSpecs_Cap ]; SpecifierT ArrSpecs[ AST::ArrSpecs_Cap ];
CodeSpecifiers NextSpecs;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -542,6 +561,7 @@ CodeParam Params;
Code Declaration; Code Declaration;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -570,6 +590,7 @@ CodeParam Params;
Code ArrExpr; Code ArrExpr;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -609,7 +630,8 @@ Serialization:
<ModuleFlags> typedef <UnderlyingType> <Name>; <InlineCmt> <ModuleFlags> typedef <UnderlyingType> <Name>; <InlineCmt>
// Functions // Functions
<ModuleFlags> typedef <Name>; <InlineCmt> <ModuleFlags> typedef <ReturnType> <Name>( <Parameters> ); <InlineCmt>
<ModuleFlags> typedef <ReturnType> ( <Expression that yeilds an Identifier signature> )( <Parameters> ); <InlineCmt>
``` ```
## Union ## Union

View File

@ -90,7 +90,7 @@ struct AST_Class
}; };
CodeType Prev; CodeType Prev;
CodeType Next; CodeType Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -116,7 +116,7 @@ struct AST_Constructor
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
char _PAD_NAME_[ sizeof(StringCached) ]; char _PAD_NAME_[ sizeof(StringCached) ];
CodeT Type; CodeT Type;
@ -132,7 +132,7 @@ struct AST_Define
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -156,7 +156,7 @@ struct AST_Destructor
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
char _PAD_NAME_[ sizeof(StringCached) ]; char _PAD_NAME_[ sizeof(StringCached) ];
CodeT Type; CodeT Type;
@ -181,7 +181,7 @@ struct AST_Enum
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -198,7 +198,7 @@ struct AST_Exec
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -214,7 +214,7 @@ struct AST_Expr
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -229,7 +229,7 @@ struct AST_Expr_Assign
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -244,7 +244,7 @@ struct AST_Expr_Alignof
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -259,7 +259,7 @@ struct AST_Expr_Binary
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -274,7 +274,7 @@ struct AST_Expr_CStyleCast
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -289,7 +289,7 @@ struct AST_Expr_FunctionalCast
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -304,7 +304,7 @@ struct AST_Expr_CppCast
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -319,7 +319,7 @@ struct AST_Expr_ProcCall
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -334,7 +334,7 @@ struct AST_Expr_Decltype
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -349,7 +349,7 @@ struct AST_Expr_Comma
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -364,7 +364,7 @@ struct AST_Expr_AMS
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -379,7 +379,7 @@ struct AST_Expr_Sizeof
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -394,7 +394,7 @@ struct AST_Expr_Subscript
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -409,7 +409,7 @@ struct AST_Expr_Ternary
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -424,7 +424,7 @@ struct AST_Expr_UnaryPrefix
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -439,7 +439,7 @@ struct AST_Expr_UnaryPostfix
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -454,7 +454,7 @@ struct AST_Expr_Element
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -476,7 +476,7 @@ struct AST_Extern
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -492,7 +492,7 @@ struct AST_Include
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -514,7 +514,7 @@ struct AST_Friend
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -539,7 +539,7 @@ struct AST_Fn
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -553,7 +553,7 @@ struct AST_Module
char _PAD_[ sizeof(SpecifierT) * AST::ArrSpecs_Cap + sizeof(AST*) ]; char _PAD_[ sizeof(SpecifierT) * AST::ArrSpecs_Cap + sizeof(AST*) ];
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -574,7 +574,7 @@ struct AST_NS
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -600,7 +600,7 @@ struct AST_Operator
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -626,7 +626,7 @@ struct AST_OpCast
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -649,7 +649,7 @@ struct AST_Param
}; };
CodeParam Last; CodeParam Last;
CodeParam Next; CodeParam Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -666,7 +666,7 @@ struct AST_Pragma
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -682,7 +682,7 @@ struct AST_PreprocessCond
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -696,7 +696,7 @@ struct AST_Specifiers
CodeSpecifiers NextSpecs; CodeSpecifiers NextSpecs;
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -713,7 +713,7 @@ struct AST_Stmt
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -728,7 +728,7 @@ struct AST_Stmt_Break
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -743,7 +743,7 @@ struct AST_Stmt_Case
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -758,7 +758,7 @@ struct AST_Stmt_Continue
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -773,7 +773,7 @@ struct AST_Stmt_Decl
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -788,7 +788,7 @@ struct AST_Stmt_Do
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -803,7 +803,7 @@ struct AST_Stmt_Expr
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -818,7 +818,7 @@ struct AST_Stmt_Else
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -833,7 +833,7 @@ struct AST_Stmt_If
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -848,7 +848,7 @@ struct AST_Stmt_For
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -863,7 +863,7 @@ struct AST_Stmt_Goto
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -878,7 +878,7 @@ struct AST_Stmt_Label
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -893,7 +893,7 @@ struct AST_Stmt_Switch
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -908,7 +908,7 @@ struct AST_Stmt_While
} }
CodeExpr Prev; CodeExpr Prev;
CodeExpr Next; CodeExpr Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -934,7 +934,7 @@ struct AST_Struct
}; };
CodeType Prev; CodeType Prev;
CodeType Next; CodeType Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -957,7 +957,7 @@ struct AST_Template
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -986,7 +986,7 @@ struct AST_Type
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -1013,7 +1013,7 @@ struct AST_Type
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;
@ -1036,7 +1036,7 @@ struct AST_Typedef
}; };
Code Prev; Code Prev;
Code Next; Code Next;
parser::Token* Token; parser::Token* Tok;
Code Parent; Code Parent;
StringCached Name; StringCached Name;
CodeT Type; CodeT Type;

View File

@ -166,16 +166,16 @@ namespace parser {
} }
struct ParseInfo struct ParseInfo
{
Arena file_mem;
Arena token_mem;
Arena code_mem;
FileContents file_content; Arena FileMem;
Array<parser::Token> tokens; Arena TokMem;
Array<parser::Error> errors; Arena CodeMem;
FileContents FileContent;
Array<parser::Token> Tokens;
Array<parser::Error> Errors;
// Errors are allocated to a dedicated general arena. // Errors are allocated to a dedicated general arena.
}; ;
CodeBody parse_file( StrC path ); CodeBody parse_file( StrC path );
#endif #endif