Notch Language
Full language support for the Notch programming language (.notch files), including syntax highlighting, error detection, IntelliSense, and more.
Features
Syntax Highlighting
Keywords, types, identifiers, numbers, operators, and comments are all coloured automatically when you open a .notch file.
| Token |
Examples |
| Keywords |
notnot, not, notifh, notelseh, notwhileh, ch |
| Types |
notinth, no |
| Identifiers |
notah, notfibh |
| Numbers |
0, 42 |
| Comments |
yes this is a comment |
Error Detection
Errors appear as red underlines with a message as you type. Three phases are checked:
Lexical — unrecognised characters that are not part of the language.
Syntax — structural mistakes:
- Missing
nt at the end of a statement
- Missing
{ or } around a block
- Missing
) or ( around a condition or parameter list
- Wrong token where a keyword or identifier was expected
Semantic — logical mistakes:
| Error | Example |
|---|---|
| Undeclared variable | Using notah before not notinth notah |
| Redeclared variable | Two not notinth notah in the same function |
| Uninitialized variable | Using a variable declared without = value |
| Undeclared function | Calling notfakeh ) ( that was never defined |
| Redeclared function | Two notnot blocks with the same name |
| Wrong argument count | Passing 2 args to a function that takes 1 |
| Division by zero | notah / 0 |
| Return from void | ch 5 nt inside a no function |
| Missing return value | ch nt inside a notinth function |
Snippets
Type a prefix and press Tab to expand a full template.
| Prefix |
Expands to |
var |
Variable declaration with initializer |
varnoinit |
Variable declaration without initializer |
func |
Function declaration |
funcvoid |
Void function with no parameters |
main |
Main function |
if |
If statement |
ifelse |
If-else statement |
while |
While loop |
ch |
Return with value |
chvoid |
Return from void function |
yes |
Line comment |
Hover over any identifier to see its details.
- Functions — signature, return type, and number of parameters.
- Variables — declared type, line of declaration, and whether it has been initialized.
Auto-complete (IntelliSense)
Press Ctrl+Space inside a .notch file to get suggestions:
- All functions defined in the file, with a ready-to-use call snippet (parameters pre-filled as tab stops).
- All variables declared in the current function scope.
Go to Definition
Ctrl+Click (or press F12) on any variable or function name to jump to where it was declared.
Document Outline
The OUTLINE panel in the left sidebar lists all functions in the file with their return type and parameter count. Click any entry to jump to that function.
Compile & Run
Press F5 to save, compile, and execute the active .notch file. The Notch output panel opens automatically and shows the full result of the compilation pipeline followed by the program's runtime output, all in one step.
| Phase |
What you see |
| Lexical analysis |
Confirmation that all tokens were recognised correctly, or the first lexical error found. |
| Syntax analysis |
Confirmation that the structure is valid, followed by the full parse tree of your program. |
| Symbol table |
All functions and variables registered during parsing, grouped by scope. |
| Semantic analysis |
Type and logic checks (undeclared variables, wrong argument counts, etc.). |
| TAC |
Three-address code — the intermediate representation used before code generation. |
| MIPS |
The final MIPS assembly code generated from your program. |
If any phase finds an error, the compiler prints it and stops — later phases are not run.
Once the MIPS assembly is generated, MARS (MIPS Assembler and Runtime Simulator) automatically executes it and appends a Program Output section to the panel. Any values printed by the program via MIPS syscalls appear there.
The output panel is cleared and reused on every run. Two files are also written to disk (updated on every run):
| File |
Contents |
compiler/files/config/TAC.txt |
Three-address code intermediate representation |
compiler/files/output/program.asm |
Final MIPS assembly |
MARS
MARS is bundled inside the extension as compiler/mars.jar and requires no separate installation. It is the standard MIPS simulator used in university computer architecture courses — source.
Java 25 required. The extension searches for a suitable Java automatically: it checks JAVA_HOME, then java in PATH, then common install folders (Eclipse Adoptium, Microsoft, Amazon Corretto, JetBrains JBR). If none is found, a message will prompt you to install OpenJDK 25 from jdk.java.net/25. You can also override the path manually via Settings → Extensions → Notch → Java Executable.
Press Shift+Alt+F to auto-format the entire file:
- Each statement is placed on its own line.
{ stays on the same line as the opening keyword.
} is placed on its own dedented line.
} notelseh { stays on one line.
- Consistent spacing between all tokens.
Language Quick Reference
yes This is a comment
notnot notinth notadderh ) notinth notah . notinth notbh ( {
ch notah + notbh nt
}
notinth notch ) ( {
not notinth notresulth = notadderh ) 3 . 4 ( nt
notifh ) notresulth > 5 ( {
not notinth notxh = 10 nt
} notelseh {
not notinth notxh = 0 nt
}
notwhileh ) notresulth > 0 ( {
notresulth = notresulth - 1 nt
}
ch 0 nt
}