You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The crucible-syntax parser is extensible; the ParserHooks type allows clients to define custom parsers that are applied in type and statement positions. However, language extensions may additionally want to add new top-level forms. Consider the case of Crucible-LLVM, where we might wish to add:
LLVM global variables (to be contrasted with Crucible global variables)
LLVM declarations (that use LLVM types), to be resolved into common overrides such as malloc, free, memcpy, etc.
LLVM metadata (if we ever want to have accurate round-tripping of parsed LLVM modules through this syntax)
These data don't fit nicely into the ParsedProgram nor SyntaxState types (the latter is the state of the TopParser monad). One option would be to add an additional type parameter (sext) to ParsedProgram, and SyntaxState, where both would gain a field of that type that could be modified by the top-level form parser extension. The parser extension could then stash whatever data it wants in there (e.g., LLVM declarations from the llvm-pretty package).
The text was updated successfully, but these errors were encountered:
The
crucible-syntax
parser is extensible; theParserHooks
type allows clients to define custom parsers that are applied in type and statement positions. However, language extensions may additionally want to add new top-level forms. Consider the case of Crucible-LLVM, where we might wish to add:malloc
,free
,memcpy
, etc.These data don't fit nicely into the
ParsedProgram
norSyntaxState
types (the latter is the state of theTopParser
monad). One option would be to add an additional type parameter (sext
) toParsedProgram
, andSyntaxState
, where both would gain a field of that type that could be modified by the top-level form parser extension. The parser extension could then stash whatever data it wants in there (e.g., LLVM declarations from the llvm-pretty package).The text was updated successfully, but these errors were encountered: