FParsec: Parsing a List of Dynamic Keywords

In the previous post we mentioned code that parses Push types and Push operations: Tokens for Push types are a dynamic collection of keywords. "Dynamic" in a sense that a developer might add to it when extending the language. We therefore need to create a parser that would recognize tokens from a dynamic set. Since … Continue reading FParsec: Parsing a List of Dynamic Keywords →

Parsing a Push Program

Parsing with FParsec   Push has a very simple program structure: Program ::= literal | operation | ( program *)                    (1) This is reflected in the F# code, using FParsec:                  (2) FParsec parses the document by combining together atomic parsers in different ways. This makes building a parser a very intuitive process. This … Continue reading Parsing a Push Program →

First Push

Program Structure PUSH 3 is a programming language created for use in genetic programming. Detailed description of it is available here. I will just briefly re-iterate the concepts crucial to further development of this blog. Push has a very simple grammar: program ::= instruction | literal | ( program* ) In other words: an instruction is … Continue reading First Push →