parse

package
v0.0.0-...-95add9b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package parse implements the MinC parser. It is a straight forward recursive LR parser

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	scan.Scanner
	// contains filtered or unexported fields
}

Parser steps through the lexical token pairs returned by the Scanner. It verifies that the tokens receive match the syntactical specifical for the MinC language. It is important to remember that it verifies only the correctness of the order of elements, not the semantic correctness. Semantics are things like type correctness.

func (*Parser) Init

func (p *Parser) Init(fileName string, src io.Reader)

Init sets Error to write to standard error then initializes the scanner. By default, Error will write to stderr

func (*Parser) Parse

func (p *Parser) Parse() *ast.Program

Parse begins by starting the scanner in a separate goroutine. It generates an abstract syntax tree and returns a pointer to it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL