5.2. Language
Spicy provides a domain-specific language that consists of two main types of constructs: parsing elements that capture the layout of an input format; along with more standard constructs of typical imperative scripting languages, such as modules, types, declarations, expressions, etc.. While the previous section focuses on the former, we summarize the more “traditional” parts of Spicy’s language in the following.
We assume some familiarity with other scripting languages. Generally,
where not otherwise stated, think of Spicy as a “C-style scripting
language” in terms of syntax & semantics, with corresponding rules
for, e.g., block structure ({ ... }
), operator precedence,
identifier naming, etc.. If you are familiar with Zeek’s scripting
language in particular, you should be able to get up to speed with
Spicy pretty quickly.
- 5.2.1. Identifiers
- 5.2.2. Modules
- 5.2.3. Functions
- 5.2.4. Variables and Constants
- 5.2.5. Types
- 5.2.5.1. Address
- 5.2.5.2. Bitfield
- 5.2.5.3. Bool
- 5.2.5.4. Bytes
- 5.2.5.5. Enum
- 5.2.5.6. spicy::Error
- 5.2.5.7. Exception
- 5.2.5.8. Integer
- 5.2.5.9. Interval
- 5.2.5.10. List
- 5.2.5.11. Map
- 5.2.5.12. Optional
- 5.2.5.13. Port
- 5.2.5.14. Real
- 5.2.5.15. Result
- 5.2.5.16. Reference
- 5.2.5.17. Regular Expression
- 5.2.5.18. Set
- 5.2.5.19. Sink
- 5.2.5.20. Stream
- 5.2.5.21. String
- 5.2.5.22. Struct
- 5.2.5.23. Time
- 5.2.5.24. Tuple
- 5.2.5.25. Unit
- 5.2.5.26. Vector
- 5.2.5.27. Void
- 5.2.6. Statements & Operators
- 5.2.7. Packing / Unpacking Values
- 5.2.8. Conditional Compilation
- 5.2.9. Appendix