Skip to content

cwi-swat/tiny-ql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyQL: A minimal but complete implementation of QL in Rascal

Total source lines of code (SLOC): 359.

Author: Tijs van der Storm, CWI.

For the original description of QL see the task description of the language workbench competition 2013

How to use:

  • Install VS Code
  • Install the Rascal extension from the Market place
  • Clone this repository https://github.com/cwi-swat/tiny-ql
  • Add the folder tiny-ql to your VS Code workspace (don't rename the folder).
  • Open src/IDE.rsc and click on the link above the main function.

Now, the IDE for QL is enabled, and you can open the example questionnaires in examples.

Code overview:

  • Syntax.rsc: grammar for QL
  • Resolve.rsc: name resolution
  • Check.rsc: type checking and cyclic dependency checking
  • Compile.rsc: compilation to HTML and Javascript
  • IDE.rsc: IDE wiring

IDE Features:

  • Syntax highlighting
  • Jump-to-definition
  • Hover documentation
  • Error marking
  • Compile button
  • Code folding
  • Outline

Type checker features:

Errors

  • reference to undefined question
  • duplicate question declaration with different type
  • conditional expression not of boolean type
  • operands of invalid type to operator
  • computed expression not conforming to declared type.
  • cyclic data and control dependencies

Warnings

  • empty prompt
  • empty then/else-branch
  • useless condition
  • dead then-branch
  • redeclared with different prompt

Notes

Division by zero is caught at run time (an alert will be shown), and 0 will be returned.

Mutual exclusion "bugs" (see mutual.myql for an example) are detected at run time and logged to the console.

About

QL implementation in Rascal for the LWB'25 paper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages