parser

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: BSD-3-Clause Imports: 6 Imported by: 3

Documentation

Overview

Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTypePrefix added in v0.3.0

func IsTypePrefix(input string) bool

IsTypePrefix returns whether the given input string is a prefix that supports a type reference declared right after it. For example, the string `function DoSomething() ` will return `true`, as a type can be specified right after that code snippet.

func Parse

func Parse(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, source compilercommon.InputSource, input string) shared.AstNode

Parse performs parsing of the given input string and returns the root AST node.

func ParseExpression

func ParseExpression(builder shared.NodeBuilder, source compilercommon.InputSource, startIndex int, input string) (shared.AstNode, bool)

ParseExpression parses the given string as an expression.

func ParseWithCompatability added in v0.2.0

func ParseWithCompatability(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, source compilercommon.InputSource, input string) shared.AstNode

ParseWithCompatability performs parsing of the given input string and returns the root AST node. Unlike the normal Parse, this method will try *all* parser versions, starting at the latest and working backwards, until a parse succeeds or there are no additional versions.

Types

This section is empty.

Directories

Path Synopsis
Package shared defines types shared by all parser implementations.
Package shared defines types shared by all parser implementations.
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).

Jump to

Keyboard shortcuts

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