Skip to content

Parser and AST for StructueredText and Sequential Function Chart

License

Notifications You must be signed in to change notification settings

chenchunhh/iec61131lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iec61131lang

Codacy Badge Build Status CircleCI

Parser and AST for StructuredText, Sequential Function Charts and Function Blocks.

  • License: GPL v3
  • Author

Getting Started

From the repository

<project>
    ...
    <dependency>
        <groupId>edu.kit.iti.formal</groupId>
        <artifactId>iec61131lang</artifactId>
        <version>0.1.9</version>
    </dependency>
    ...
    <repositories>
        <repository>
            <id>formal-iti-kit</id>
            <url>http://formal.iti.kit.edu/</url>
        </repository>
    </repositories>
    ... 
</project>



from source

$ git clone  https://github.com/VerifAPS/iec61131lang.git
$ mvn compile assembly
$ mvn install

Changelog

  • 0.1.11
  • Bug fix in IEC61131Facade.file()

TODO

  • Unit Tests, especially for wrong expressions and statements
  • Error Messages
  • Documentation

Language Features

  • Structured Text
    • Constrol Structures
      • if-elseif-else
      • case
        • ordinals
        • enumerations
        • range
      • for
      • while
      • repeat-until
    • POUs
      • Function
      • Function Block
      • Program
    • User-defined Datatypes
      • Enums
      • Ranges
      • Arrays
      • Structs/Records
    • [?] Pointers (need to be tested)
    • Object Oriented Function Blocks
      • Interfaces
      • Extends Clause
  • Sequential Function Chart
    • Steps with Actions
    • Transitions
      • fork/join (divergence/convergence)
      • split/merge (simultanousely divergence/convergence)
      • Guards in Structured Text
    • Timed (not planned)

Sequential Function Chart Syntax

This is not a standard language.

Example:

SFC example

    VAR_OUTPUT
        o : bool;
    END_VAR

    STEP A
        on active action
            o := true;
        end_action
    END_STEP

    STEP B
       on active action
            o := false;
       end_action
    END_STEP

    GOTO true :: A -> B
    GOTO true :: B -> A
END_SFC

EBNF

<SFC>  :==  SFC <identifier>
                <elements>*
            END_SFC

<element>   :== <var_decl> | <step_decl> | <transition>
<step_decl> :== STEP <identifier>
                  on <event> (action <statement>* end_action
                             | <function-name> )
                END_STEP
<transition> :== GOTO <guard> :: <identifier>* -> <identifier>*

<event> can be either active, exit or entry. <statement> refers to valid Structured Text statements. <var_decl> responses to classical variable declearation in IEC61131-3.

About

Parser and AST for StructueredText and Sequential Function Chart

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published