@flowscripter/mpeg-sdl-parser
Version:
ISO/IEC 14496-34 Syntactic Description Language (MPEG SDL) parser implemented in TypeScript
110 lines (98 loc) • 2.13 kB
Plain Text
# Simple
class A {{utf8string foo;utf8string bar;}}
==>
Specification(
ClassDeclaration(
class
Whitespace
Identifier
Whitespace
OpenBrace
CompoundStatement(
OpenBrace
StringDefinition(
utf8string
Whitespace
Identifier
Semicolon
)
StringDefinition(
utf8string
Whitespace
Identifier
Semicolon
)
CloseBrace
)
CloseBrace
)
)
# Nested compound statements
class A {{utf8string foo;{ utf8string bar1;utf8string bar2;}}}
==>
Specification(
ClassDeclaration(
class
Whitespace
Identifier
Whitespace
OpenBrace
CompoundStatement(
OpenBrace
StringDefinition(
utf8string
Whitespace
Identifier
Semicolon
)
CompoundStatement(
OpenBrace
Whitespace
StringDefinition(
utf8string
Whitespace
Identifier
Semicolon
)
StringDefinition(
utf8string
Whitespace
Identifier
Semicolon
)
CloseBrace
)
CloseBrace
)
CloseBrace
)
)
# Compound statement with commented statement
class A {{
utf8string bar; // bar
}}
==>
Specification(
ClassDeclaration(
class
Whitespace
Identifier
Whitespace
OpenBrace
CompoundStatement(
OpenBrace
Whitespace
StringDefinition(
utf8string
Whitespace
Identifier
Semicolon
)
Whitespace
Comment
Whitespace
CloseBrace
)
CloseBrace
)
)