@flowscripter/mpeg-sdl-parser
Version:
ISO/IEC 14496-34 Syntactic Description Language (MPEG SDL) parser implemented in TypeScript
153 lines (137 loc) • 2.89 kB
Plain Text
# Elementary type output
map offsets (int) {0b00,{1024},0b00,{1024}}
==>
Specification(
MapDeclaration(
map
Whitespace
Identifier
Whitespace
OpenParenthesis
ElementaryType(
int
)
CloseParenthesis
Whitespace
OpenBrace
MapEntry(
BinaryLiteral
Comma
AggregateOutputValue(
OpenBrace
IntegerLiteral
CloseBrace
)
)
Comma
MapEntry(
BinaryLiteral
Comma
AggregateOutputValue(
OpenBrace
IntegerLiteral
CloseBrace
)
)
CloseBrace
)
)
# Class output
map barMap (Bar) {0b00,{1024}}
==>
Specification(
MapDeclaration(
map
Whitespace
Identifier
Whitespace
OpenParenthesis
Identifier
CloseParenthesis
Whitespace
OpenBrace
MapEntry(
BinaryLiteral
Comma
AggregateOutputValue(
OpenBrace
IntegerLiteral
CloseBrace
)
)
CloseBrace
)
)
# Nested outputs
map barMap (Bar) {0b00,{1024,{1,2}}}
==>
Specification(
MapDeclaration(
map
Whitespace
Identifier
Whitespace
OpenParenthesis
Identifier
CloseParenthesis
Whitespace
OpenBrace
MapEntry(
BinaryLiteral
Comma
AggregateOutputValue(
OpenBrace
IntegerLiteral
Comma
AggregateOutputValue(
OpenBrace
IntegerLiteral
Comma
IntegerLiteral
CloseBrace
)
CloseBrace
)
)
CloseBrace
)
)
# Escape codes
map offsets (int) {0b00,{int(6)}}
==>
Specification(
MapDeclaration(
map
Whitespace
Identifier
Whitespace
OpenParenthesis
ElementaryType(
int
)
CloseParenthesis
Whitespace
OpenBrace
MapEntry(
BinaryLiteral
Comma
AggregateOutputValue(
OpenBrace
ElementaryTypeOutputValue(
ElementaryType(
int
)
LengthAttribute(
OpenParenthesis
UnaryExpression(
IntegerLiteral
)
CloseParenthesis
)
)
CloseBrace
)
)
CloseBrace
)
)