Enum piske::symbol::Symbol
[−]
[src]
pub enum Symbol { BuiltinType { name: Identifier, ty: PType, }, Variable { name: Identifier, ty: Option<PType>, }, Function { name: Identifier, ret_ty: Option<PType>, body: FunctionBody, params: Vec<Node<Parameter>>, }, }
Symbol object (for use in symbol tables).
Variants
BuiltinType
Built-in types
Fields of BuiltinType
name: Identifier | Name of the built-in type (a keyword) |
ty: PType | PType associated with the name |
Variable
Variables
Fields of Variable
name: Identifier | Name of the variable |
ty: Option<PType> | Type of this variable (an Option, since this type is not known at all times of the computation) |
Function
Functions
Fields of Function
name: Identifier | Name of the function |
ret_ty: Option<PType> | Return type of the function (an Option since this type is not known at all times of the computation) |
body: FunctionBody | Function Body |
params: Vec<Node<Parameter>> | Function parameters, |
Methods
impl Symbol
[src]
fn builtin(name: Identifier, ty: PType) -> Symbol
[src]
Create a builtin type Symbol, with specified type
fn function(
name: Identifier,
ty: Option<PType>,
body: Node<Block>,
params: Vec<Node<Parameter>>
) -> Symbol
[src]
name: Identifier,
ty: Option<PType>,
body: Node<Block>,
params: Vec<Node<Parameter>>
) -> Symbol
Create a function Symbol, with specified type
fn ext_function(
name: Identifier,
ty: Option<PType>,
body: ExtFuncIdent,
params: Vec<Node<Parameter>>
) -> Symbol
[src]
name: Identifier,
ty: Option<PType>,
body: ExtFuncIdent,
params: Vec<Node<Parameter>>
) -> Symbol
Create a function Symbol, with specified type
fn variable(name: Identifier, ty: Option<PType>) -> Symbol
[src]
Create a variable Symbol
fn is_stdlib_func(&self) -> bool
[src]
Return true if symbol is a standard library function
Trait Implementations
impl Clone for Symbol
[src]
fn clone(&self) -> Symbol
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Symbol
[src]
impl PartialEq for Symbol
[src]
fn eq(&self, __arg_0: &Symbol) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Symbol) -> bool
[src]
This method tests for !=
.