Documentation

LKAST class documentation

LKAST : NSObject

AuthorsGenerated by builder
Declared inLKAST.h

Overview

Root class for AST nodes. Every node in the abstract syntax tree inherits from this. It stores the parent, allowing navigation up the tree, and a pointer to the symbol table for this scope.


Default

+ (NSMutableDictionary *) code

Returns the AST nodes available at runtime for subclasses and categories.

    - (LKModule *) module

    Returns the module containing the current AST.

      - (id) initWithSymbolTable: (LKSymbolTable *)aSymbolTable

      Initialise a new AST node with the specified symbol table.

        - (void) setBracketed: (BOOL)aFlag

        Set whether the AST node represents a bracketed expression.

          - (BOOL) isBracketed

          Returns whether the AST node represents a bracketed expression.

            - (void) inheritSymbolTable: (LKSymbolTable *)aSymbolTable

            Inherits the given symbol table from the parent.

              - (void) setParent: (LKAST *)aNode

              Sets the parent of this node. Also sets connections between the nodes' symbol tables.

                - (LKAST *) parent

                Returns the parent of this AST node.

                  - (LKSymbolTable *) symbols

                  Returns the symbol table for this node.

                    - (void) print

                    Prints the syntax tree from this node. Use only for debugging.

                      - (BOOL) check

                      Performs semantic analysis on this node and all of its children.

                        - (BOOL) checkWithErrorReporter: (id <LKCompilerDelegate>)errorReporter

                        Performs semantic analysis on this node and all of its children, reporting errors and warnings to the object specified by the argument.

                          - (void*) compileWithGenerator: (id <LKCodeGenerator>)aGenerator

                          Compile this AST node with the specified code generator.

                            - (BOOL) isComment

                            Returns YES for AST nodes with no code generation

                              - (BOOL) isBranch

                              Returns YES for AST nodes that branch unconditionally.