[][src]Enum piske::symbol::Symbol

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]

pub fn builtin(name: Identifier, ty: PType) -> Symbol[src]

Create a builtin type Symbol, with specified type

pub fn function(
    name: Identifier,
    ty: Option<PType>,
    body: Node<Block>,
    params: Vec<Node<Parameter>>
) -> Symbol
[src]

Create a function Symbol, with specified type

pub fn ext_function(
    name: Identifier,
    ty: Option<PType>,
    body: ExtFuncIdent,
    params: Vec<Node<Parameter>>
) -> Symbol
[src]

Create a function Symbol, with specified type

pub fn variable(name: Identifier, ty: Option<PType>) -> Symbol[src]

Create a variable Symbol

pub 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_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<Symbol> for Symbol[src]

impl Display for Symbol[src]

impl Debug for Symbol[src]

impl SymbolStore<Symbol> for Annotation[src]

Auto Trait Implementations

impl !Send for Symbol

impl !Sync for Symbol

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.