fpp/compiler/tools/fpp-syntax/test/syntax-stdin.ref.txt
2025-09-17 22:21:48 -07:00

576 lines
12 KiB
Plaintext

@ Definitions and specifiers
def module
ident DefinitionsAndSpecifiers
@ Abstract type definition
def abs type
ident T
@< Abstract type definition
@ Type alias definition
def alias type
ident TA
type name qual ident T
@< Type alias definition
@ Array definition
def array
ident A
size literal int 10
type name U32
default literal int 0
format {} counts
@< Array definition
@ State machine outside a component
def state machine
ident SO
@< State machine outside a component
@ Interface definition
def interface
ident I
@ General port instance specifier
spec port instance general
kind sync input
ident pI
array size literal int 10
port type qual ident P
priority literal int 10
queue full assert
@< General port instance specifier
@ Special port instance specifier
spec port instance special
kind command recv
ident cmdIn
@< Special port instance specifier
@ Interface import specifier
spec interface import
qual ident J
@< Interface import specifier
@< Interface definition
@ Component definition
def component
kind active
ident C
def abs type
ident T
def array
ident A
size literal int 3
type name U32
def struct
ident S
struct type member
ident x
array size literal int 3
type name U32
struct type member
ident y
type name F32
struct type member
ident z
type name string
def enum
ident E
def enum constant
ident X
def enum constant
ident Y
def enum constant
ident Z
default ident X
@ Container specifier
spec container
ident C
id literal int 0x00
default priority literal int 10
@< Container specifier
@ Record specifier
spec record
ident R
type name U32 array
id literal int 0x00
@< Record specifier
@ Command specifier
spec command
kind async
name ident C
formal param
kind value
ident a
type name U32
formal param
kind value
ident b
type name F32
opcode literal int 0x00
priority literal int 10
queue full assert
@< Command specifier
@ Parameter specifier
external spec param
ident P
type name U32
default literal int 0
id literal int 0x00
set opcode literal int 0x01
save opcode literal int 0x02
@< Parameter specifier
@ General port instance specifier
spec port instance general
kind sync input
ident p1
array size literal int 10
port type qual ident P
priority literal int 10
queue full assert
@< General port instance specifier
@ Special port instance specifier
spec port instance special
kind command recv
ident cmdIn
@< Special port instance specifier
@ Async product receive port
spec port instance special
input kind async
kind product recv
ident productRecvIn
priority literal int 10
queue full assert
@< Async product receive port
@ Internal Component State machine definition
def state machine
ident S
@< State machine definition
@ State machine instance 1
spec state machine instance
ident s1
state machine qual ident S
priority literal int 10
queue full drop
@< State machine instance 1
@ State machine instance 2
spec state machine instance
ident s2
state machine qual ident S
@< State machine instance 2
@ State machine for outside definition
spec state machine instance
ident so
state machine qual ident SO
@< State machine for outside definition
spec port instance general
kind output
ident p2
array size literal int 10
port type qual ident P
@ Port matching specifier
spec port matching
ident p1
ident p2
@< Port matching specifier
@ Telemetry channel specifier
spec tlm channel
ident T
type name U32
id literal int 0x00
update on change
format {} s
low limit
red
literal int 0
low limit
orange
literal int 1
low limit
yellow
literal int 2
high limit
yellow
literal int 10
high limit
orange
literal int 11
high limit
red
literal int 12
@< Telemetry channel specifier
@ Event specifier
spec event
ident E
formal param
kind value
ident a
type name U32
formal param
kind value
ident b
type name F32
severity activity low
id literal int 0x00
format {} counts
throttle literal int 10
@< Event specifier
@ Event specifier with throttle timeout
spec event
ident ET
formal param
kind value
ident a
type name U32
formal param
kind value
ident b
type name F32
severity activity high
id literal int 0x00
format {} counts
throttle literal int 10
every expr struct
struct member
ident seconds
literal int 10
@< Event specifier
@ Internal port specifier
spec internal port
ident I
formal param
kind value
ident a
type name U32
formal param
kind value
ident b
type name F32
priority literal int 10
queue full assert
@< Internal port specifier
@ Interface import specifier
spec interface import
qual ident I
@< Interface import specifier
@< Component definition
@ Simple component instance definition
def component instance
ident c1
component qual ident C1
base id literal int 0x100
@< Simple component instance definition
@ Component instance definition
def component instance
ident c2
component qual ident C2
base id literal int 0x200
type T
file C2.hpp
queue size literal int 100
stack size literal int 1024
priority literal int 10
cpu literal int 0
@ Init specifier
spec init
phase ident CONSTRUCTION
code line 1
line 2
line 3
@< Init specifier
@< Component instance definition
@ Constant definition
def constant
ident x
literal int 0
@< Constant definition
@ Enum definition
def enum
ident E
type name I32
@ X
def enum constant
ident X
literal int 1
@< X
@ Y
def enum constant
ident Y
literal int 2
@< Y
@< Enum definition
@ Module definition
def module
ident M
def constant
ident x
literal int 0
@< Module definition
@ Included constant
def constant
ident x
literal int 0
@< Included constant
@ Port definition
def port
ident P
formal param
kind value
ident a
type name U32
formal param
kind value
ident b
type name F32
return type name U32
@< Port definition
@ Struct definition
def struct
ident S
@ x
struct type member
ident x
type name U32
format {} s
@< x
@ y
struct type member
ident y
type name F32
format {} m/s
@< y
@< Struct definition
@ Topology definition
def topology
ident T
@ Public instance specifier
spec comp instance
public
qual ident i1
@< Public instance specifier
@ Private instance specifier
spec comp instance
private
qual ident i2
@< Private instance specifier
@ Direct connection graph specifier
spec connection graph direct
ident C
connection
from port qual ident i1.p
index literal int 0
to port qual ident i2.p
index literal int 1
unmatched connection
from port qual ident i1.p1
index literal int 0
to port qual ident i2.p2
index literal int 0
unmatched connection
from port qual ident i1.p1
to port qual ident i2.p2
@< Direct connection graph specifier
@ Graph pattern specifier
spec connection graph pattern
kind command
source qual ident i1
target qual ident i2
target qual ident i3
target qual ident i4
@< Graph pattern specifier
@ Topology import specifier
spec top import
qual ident T1
@< Topology import specifier
@ Telemetry packet group
spec tlm packet set
ident P
members
@ Telemetry packet
spec tlm packet
ident P1
id literal int 0
group literal int 0
tlm channel identifier
qual ident i1.c1
tlm channel identifier
qual ident i2.c2
@< Telemetry packet
@ Included packet
spec tlm packet
ident P2
id literal int 1
group literal int 1
tlm channel identifier
qual ident i4.c4
tlm channel identifier
qual ident i5.c5
@< Included packet
omitted
qual ident i3.c3
@< Telemetry packet group
@< Topology definition
@ Location specifier
spec loc
kind instance
symbol qual ident i
file instances.fpp
@< Location specifier
@< Definitions and specifiers
@ Type names
def module
ident TypeNames
def array
ident typeNameU32
size literal int 10
type name U32
def array
ident typeNameF32
size literal int 10
type name F32
def array
ident typeNameBool
size literal int 10
type name bool
def array
ident typeNameString
size literal int 10
type name string
size literal int 256
def array
ident typeNameQID
size literal int 10
type name qual ident a.b.c
@< Type names
@ Expressions
def module
ident Expressions
@ Arithmetic
def constant
ident arithExp
expr binop
expr binop
expr binop
literal int 1
binop +
expr binop
literal int 2
binop *
literal int 3
binop -
expr binop
expr unop
unop -
literal int 4
binop *
literal int 5
binop +
literal int 6
@< Arithmetic
@ Array
def constant
ident arrayExp
expr array
literal int 1
literal int 2
literal int 3
@< Array
@ Array Subscript
def constant
ident arraySubExp1
expr array subscript
expr array
literal int 1
literal int 2
literal int 3
literal int 1
@< Array Subscript
@ Array Subscript
def constant
ident arraySubExp2
expr array subscript
expr dot
expr dot
ident a
ident b
ident c
literal int 1
@< Array Subscript
@ Array Subscript with member selection
def constant
ident arraySubExp2
expr array subscript
expr dot
expr array subscript
expr array subscript
expr dot
expr dot
ident a
ident b
ident c
literal int 1
literal int 2
ident s
literal int 12
@< Array Subscript
@ Boolean literal
def constant
ident booleanLiteralExp
literal bool true
@< Boolean literal
@ Dot
def constant
ident dotExp
expr dot
expr dot
ident a
ident b
ident c
@< Dot
@ FP literal
def constant
ident fpLiteralExp
literal float 0.1234
@< FP literal
@ Identifier
def constant
ident identExp
ident x
@< Identifier
@ Int literal
def constant
ident intLiteralExp
literal int 1234
@< Int literal
@ Paren
def constant
ident parenExp
expr binop
expr paren
expr binop
literal int 1
binop +
literal int 2
binop *
literal int 3
@< Paren
@ String literal single
def constant
ident stringLiteralSingleExp
literal string This is a string.
@< String literal single
@ String literal multi
def constant
ident stringLiteralMultExp
literal string line 1
line 2
line 3
@< String literal multi
@ Struct
def constant
ident structExp
expr struct
struct member
ident a
literal int 1
struct member
ident b
literal int 2
struct member
ident c
literal int 3
@< Struct
@< Expressions