In one of the previous posts the following definition for parsing simple Push types was discussed: The most noteworthy entry here is pushSimpleTypes. This parser is created dynamically from internally implemented Push types (INTEGER, FLOAT, etc) and may be dynamically extended if it becomes necessary to parse a new type. The dynamic parser is built … Continue reading FParsec: Creating a Parser Dynamically
Category: F#
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
Bootstrapping
This blog chronicles my study of FSharp by means of implementing a simple programming language PUSH 3. The language was invented at Hampshire College for experiments in genetic programming. It is described in detail http://hampshire.edu/lspector/push3-description.html as well as in a number of books and papers by Lee Spector (http://hampshire.edu/lspector/). In the spirit of a talmudic … Continue reading Bootstrapping