- Notifications
You must be signed in to change notification settings - Fork4
A GOLD Engine implementation in FPC
License
NotificationsYou must be signed in to change notification settings
Warfley/FPCGoldEngine
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is an engine for the GOLD Parsing System (http://goldparser.org/) written in FreePascal.
See the example for a small program that builds a parse tree and uses the Lexer to Colorize aTSynEdit
- v1.0 and v5.0 support
- event based parse tree construction
functionTMyClass.BuildTreeNode(const Produces: TGrammarSymbol; Consumes:specialize TArray<TObject>): TObject;begin Result := TParseTree.Create(Produces.Name, Consumes);end;functionTMyClass.BuildLeafNode(const AToken: TToken): TObject;begin Result := TParseTreeLeaf.Create(AToken.Name);end;... Grammar := TCGTGrammar.Create;try Grammar.LoadFromFile(FileName); ParseTree := Grammar.ParseString(InputString, @BuildTreeNode, @BuildLeafNode);finally Grammar.Free;end;
Currently no documentation available specifically for the node engine.
For general engine design and how to construct your own engine check outhttps://github.com/Warfley/goldengine/docs