Synopsis The classical toy language, including a specialized IDE.
Description Pico is a toy language that has been used as example over the years in many projects and disguishes,
Pico has a single purpose in life: being so simple that specifications of every possible language aspect are so simple that they fit on a few pages. It can be summarized as follows:
- There are two types: natural numbers and strings.
- Variables have to be declared.
- Statements are assignment, if-then-else and while-do.
- Expressions may contain naturals, strings, variables, addition (
+
), subtraction (-
) and concatenation (||
).
- The operators
+
and -
have operands of type natural and their result is natural.
- The operator
||
has operands of type string and its results is also of type string.
- Tests in if-then-else statement and while-statement should be of type natural.
The following aspects of the Pico language will be discussed:
- Syntax: Concrete syntax for Pico.
- Abstract: Abstract syntax for Pico.
- Load: Convert a Pico parse tree into a Pico abstract syntax tree.
- Typecheck: Typechecker a Pico program.
- Evaluate: Evaluate a Pico program.
- Assembly: Assembly language for Pico.
- Compile: Compile a Pico program to assembly language.
- UseDef: Compute use-def information for the variables in a Pico program.
- ControlFlow: Compute the control flow graph for a Pico program.
- Visualize: Visualize Pico Control Flow Graphs.
- Uninit: Find unitialized variables in a Pico program.
- IDE: An Integrated Development Environment for Pico.