Skip to content

Add stack counter #23

@Shalmezad

Description

@Shalmezad

Think I found a good way to handle checking for valid programs.

A number of the tokens require specific conditions (ie: tanh requires 1 token on the stack, + requires 2 tokesn on the stack), and yield a certain change (+ pops 2, pushes 1, tanh pops 1 pushes 1, a constant pushes 1). Using this, I can validate that the stack is syntactically correct, and more importantly, used all the tokens in the stack (ends with 1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions