Index

Package: Parsers

Description

package Scripting.Parsers is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Parser

type Parser is new Limited_Object with private;

Ancestors:

Primitive operations:

Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.To_String (Inherited)
A Parser parses input from a token scanner. Given a token scanner loaded with an input stream, the parser will read tokens from the scanner and create a corresponding abstract syntax tree.

Types

A_Parser

type A_Parser is access all Parser'Class;

Subprograms & Entries

Create_Parser

function Create_Parser return A_Parser;
Creates and returns a new Parser.

Expect_Expression

function Expect_Expression
( this: not null access Parser'Class;
scanner: not null A_Token_Scanner ) return A_Expression;
Scans an expression or raises Parse_Exception if one is not found. Parse_Exception will be raised if a parsing error occurs. Token_Exception will be raised if an unrecognized token is encountered by the scanner.

Scan_Expression

function Scan_Expression
( this: not null access Parser'Class;
scanner: not null A_Token_Scanner ) return A_Expression;
Scans an expression or returns null if one is not found. Parse_Exception will be raised if a parsing error occurs. Token_Exception will be raised if an unrecognized token is encountered by the scanner.

Scan_Script

function Scan_Script
( this: not null access Parser'Class;
scanner: not null A_Token_Scanner ) return A_Script;
Scans a script or returns null if one is not found. Parse_Exception will be raised if a parsing error occurs. Token_Exception will be raised if an unrecognized token is encounter by the scanner. The grammar implemented by this function is: script := <statement_list>

Delete

procedure Delete
( this: in out A_Parser );
Deletes the Parser.