Class: Tree

tree. Tree

new Tree(stack)

Represents a Tree.
Parameters:
Name Type Description
stack array A stack of tokens to parse.
Source:

Methods

(static) Tree#constructComment(root) → {object}

Build a descriptor to describe an instance of a comment.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructConditional(root, kind) → {object}

Build a descriptor to describe an instance of a conditional.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
kind string A way to determine else from elsif.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructEach(root) → {object}

Build a descriptor to describe an instance of a loop.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructExpression(root, END) → {object}

Build a descriptor to describe an instance of an expression.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
END string Token name to cause an expression to end processing.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructExtend(root) → {object}

Build a descriptor to describe an instance of an extend.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructFilter(root) → {object}

Build a descriptor to describe an instance of a filter.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructPartial(root) → {object}

Build a descriptor to describe an instance of a partial.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
Source:
Returns:
The root element decorated.
Type
object

(static) Tree#constructProperty(encoded) → {object}

Build a descriptor to describe an instance of a property.
Parameters:
Name Type Description
encoded boolean Whether or not to encode this property.
Source:
Returns:
Either a property descriptor or filter pass.
Type
object

(static) Tree#make(root, END) → {object}

Takes in an element from the stack of generated tokens.
Parameters:
Name Type Description
root object Current token in stack or tree node to process.
END string Token name to cause an expression to end processing.
Source:
Returns:
The root element decorated or null to stop.
Type
object