Vybe Documentation
Vybe Main page
Grammar & Syntax
This file documents the syntactic structures and statements supported by the Vybe parser.
Declarations
Program Structure
- Module:
Module ... End Module - Class:
Class ... End Class - Enum:
Enum ... End Enum
Procedure Declarations
- Sub:
Sub Name(params) ... End Sub - Function:
Function Name(params) As Type ... End Function - Property:
Property Name As Type ... [Get ... End Get] [Set ... End Set] End Property
Variables & Constants
- Dim:
Dim Name [As Type] [= Value] - Const:
[Visibility] Const Name As Type = Value
Control Flow Statements
Conditional
- If...Then: Multi-line and single-line
Ifstatements. - Select Case: Supports value matching, ranges (
1 To 10), and comparison rules (Is > 5).
Loops
- For...Next: Standard counting loop.
- For Each: Collection iteration.
- While: Pre-condition loop.
- Do...Loop: Supports
WhileandUntilclauses at start or end.
Error Handling
- Try...Catch: Structured error handling with
CatchandFinallyblocks.
Expressions
- Arithmetic:
+,-,*,/,\,^,Mod,&(string concatenation). - Logical:
And,Or,Not,AndAlso,OrElse,Xor. - Comparison:
=,<>,<,<=,>,>=,Is,IsNot. - Primary: Variable access, method calls, constant access, and literals.
- Advanced: Lambda expressions, array literals.