Skip to content

LGeoff31/MetaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MetaScript ๐ŸŒŸ

MetaScript is a lightweight scripting language designed for educational purposes. It demonstrates fundamental concepts of language design, including tokenizing, parsing, and interpretation.

Features ๐Ÿ› ๏ธ

** Tokenizer ๐Ÿ”
Built a lexer to convert source code into an array of tokens. Tokens are categorized into keywords, identifiers, operators, and literals.

** AST Definitions ๐ŸŒณ
Define the Abstract Syntax Tree (AST) structure. The AST represents the hierarchical syntax of the code, derived from the tokens produced by the lexer.

** Parser ๐Ÿงฉ
Parser to convert tokens into the AST. This component checks code validity and ensures proper syntax based on the language's grammar.

** Interpreter ๐Ÿš€
Interpreter to execute code based on the AST. It will handle expression evaluation, statement execution, and control flow management.

Example Code ๐Ÿ’ป

fn fibonacci (n) {
    if |n <= 2| { return 1 }
    let prev = 1; let curr = 1;
    from 2 to n with i {
        let next_value = prev + curr
        prev = curr 
        curr = next_value
    }
    return curr
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors