Skip to main content

parse

Function parse 

Source
pub fn parse(src: &SourceParts) -> Result<Vec<Expr>>
Expand description

Parse a J program (one sentence per line) into IR statements.

Sentences are parsed in order over a table of the names that have been given verbs, because a name’s part of speech decides how the sentence around it parses. A sentence that names a verb records it and produces no work; a later sentence that reads the name gets the verb substituted into it. That is enough for the straight-line programs this frontend compiles: there is no control flow for a definition to reach backwards through, and reassigning the name simply rebinds it from there on.