This repository has been archived on 2026-03-01. You can view files and clone it. You cannot open issues or pull requests or push a commit.
2026-03-01 14:18:32 +11:00
2026-02-28 13:19:41 +11:00
2026-02-28 11:27:45 +11:00

Solstice rewrite in C

Not self hosting yet. Maybe once this compiler is done.

Building

bash build.c

Todo List

  • Lexer

    • Lex values
      • int
      • double
      • string
      • char
      • bool
    • Lex keywords
    • Ignore comments (//, /**/, #)
    • Lex delimiters
      • ()
      • {}
      • .
      • :
      • ,
      • ==, =
      • >, >=
      • <, <=
      • !, !=
      • +, +=, ++
      • -, -=, --
      • *, *=
      • /, /=
    • Lex types
      • Basic types (int, double, string, bool, char)
      • Advanced types (fun(...), template(...), object(...))
    • Lex identifiers
  • Parser

    • Create structure to hold nodes
    • Start parsing tree
      • puts
      • Literal values
      • '='
      • Maths
      • Brackets
      • Comparisons
      • Code blocks ({ })
      • If
      • While
      • Function Definition
      • Function Calls
      • Structs
      • new
      • use
  • Ground compiler

    • Create structure to descend tree
    • Check types
      • puts (none)
      • set (typeof children.at[1])
      • Identifiers (scope->variables[idName])
      • add (string, int, double)
      • subtract, multiply, divide (int, double)
      • Comparisons (bool)
      • Code block (none)
      • if, while (none)
      • Function definition (fun(...))
      • Function call (return type of function)
      • Struct (template(...))
      • new (children[0])
      • use (none)
    • Generate code
      • puts
      • Literal values
      • '='
      • Maths
      • Brackets
      • Comparisons
      • Code blocks ({ })
      • If
      • While
      • Function Definition
      • Function Calls
      • Structs
      • new
      • use
Description
rewrite
Readme 440 KiB
Languages
C 100%