Skip to content

Structured Script is a scripting language loosely based on Structured Text from the IEC 61131-3 Structured Text

License

Notifications You must be signed in to change notification settings

plow-technologies/structured-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

structured-script-lang Circle CI

Structured Script is.

  • A subset of Structured Text with some modernizing modifications
  • referentially transparent (no side effects)
  • Interpreted

Data Types

  • Double -- IEEE DOUBLE
  • Integer -- Variable Length Integer Type
  • String -- Packed String Type
  • Char -- UTF8
  • Bool -- Boolean Value Logical operands

Operators

(Operators in Italics are not implemented yet)

Logical

Boolean operators take Data Types and return whether one value of the data type is greater than another. Be careful when trying to compare equality between floating point numbers.

  • =
  • AND
  • OR
  • NOT

Arithmetic

  • =
  • >
  • <
  • >=
  • <=
  • +
  • -
  • /
  • *

Bitwise

  • & Bitwise And
  • OR Bitwise Or
  • XOR Bitwise exclusive Or
  • NOT Bitwise negation

##Functions## (Functions in Italics are not implemented yet)

Bitwise

  • isSet checks a bit in position N of an INT, returns true if that bit is set
    • isSet 0 4; returns False isSet 3; returns True
  • shiftN

Constructs

  • variable_name := statement ;
    • Use to assign a name to a constant or expression
    • x:=3;
  • IF bool_expression Then statement_list Else statement_list
    • Use to branch alternatives
    • IF (3 > 4) THEN x:=3; Else x:=4; END_IF

How to run tests

cabal configure --enable-tests && cabal build && cabal test

Contributing

TODO: Write contribution instructions here

About

Structured Script is a scripting language loosely based on Structured Text from the IEC 61131-3 Structured Text

Resources

License

Stars

Watchers

Forks

Packages