Skip to content

Latest commit

 

History

History
279 lines (140 loc) · 4.79 KB

grammar.md

File metadata and controls

279 lines (140 loc) · 4.79 KB

OScript Language Grammar

OScript is case-insensitive. Letters in the diagrams below are lower-case for simplicity, but they may appear upper-case too.

All white space outside of string literals, comments and the content skipped by the preprocessor is ignored, except for significant line breaks in some statements.

See also the AST node declarations.

Source File

Program

Program

Package Module

PackageDeclaration

PackageDeclaration

ObjectDeclaration

ObjectDeclaration

FeatureDeclaration

FeatureDeclaration

ObjectName

ObjectName

Executable Script

ScriptSource

ScriptSource

Dump Source

DumpSource

DumpSource

OldFeatureAddition

OldFeatureAddition

OldFeatureInitialization

OldFeatureInitialization

Scopes

ScriptDeclaration

ScriptDeclaration

FunctionDeclaration

FunctionDeclaration

Parameters

Parameters

Parameter

Parameter

Statements

Statement

Statement

IfStatement

IfStatement

SwitchStatement

SwitchStatement

WhileStatement

WhileStatement

RepeatStatement

RepeatStatement

ForStatement

ForStatement

ForEachStatement

ForEachStatement

StructuredForStatement

StructuredForStatement

BreakStatement

BreakStatement

ContinueStatement

ContinueStatement

BreakIfStatement

BreakIfStatement

ContinueIfStatement

ContinueIfStatement

LabelStatement

LabelStatement

GotoStatement

GotoStatement

ReturnStatement

ReturnStatement

VariableDeclaration

VariableDeclaration

Modifier

Modifier

Type

Type

Expressions

Expression

Expression

BinaryExpression

BinaryExpression

UnaryExpression

UnaryExpression

MemberSliceCallExpression

MemberSliceCallExpression

PrimaryExpression

PrimaryExpression

MemberExpression

MemberExpression

ListExpressionOrComprehension

ListExpressionOrComprehension

ListElement

ListElement

Identifiers

Identifier

Identifier

HashQuote

HashQuote

Xlate

Xlate

LegacyAlias

LegacyAlias

Literals

Literal

Literal

StringLiteral

StringLiteral

SingleQuotedStringLiteral

SingleQuotedStringLiteral

DoubleQuotedStringLiteral

DoubleQuotedStringLiteral

BackQuotedStringLiteral

BackQuotedStringLiteral

IntegerLiteral

IntegerLiteral

RealLiteral

RealLiteral

DateLiteral

DateLiteral

BooleanLiteral

BooleanLiteral

UndefinedLiteral

UndefinedLiteral

Objref

Objref

Comments

SingleLineComment

SingleLineComment

MultiLineComment

MultiLineComment

Preprocessor Directives

PreprocessorDirective

PreprocessorDirective

Other Tokens

HexadecimalNumber

HexadecimalNumber

Digit

Digit

Letter

Letter

LineBreak

LineBreak

WhiteSpace

WhiteSpace