All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dingyi222666.monarch.languages.LanguageSt.kt Maven / Gradle / Ivy

package io.github.dingyi222666.monarch.languages

import io.github.dingyi222666.monarch.common.*
 import io.github.dingyi222666.monarch.loader.dsl.*
import io.github.dingyi222666.monarch.types.IMonarchLanguage

public val StLanguage: IMonarchLanguage by lazy {
  buildMonarchLanguage {
    tokenPostfix = ".st"
    ignoreCase = true
    defaultToken = ""
    brackets {
      bracket("{","}","delimiter.curly")
      bracket("(",")","delimiter.parenthesis")
      bracket("[","]","delimiter.square")
    }
    keywords("if", "end_if", "elsif", "else", "case", "of", "to", "__try", "__catch", "__finally",
        "do", "with", "by", "while", "repeat", "end_while", "end_repeat", "end_case", "for",
        "end_for", "task", "retain", "non_retain", "constant", "with", "at", "exit", "return",
        "interval", "priority", "address", "port", "on_channel", "then", "iec", "file", "uses",
        "version", "packagetype", "displayname", "copyright", "summary", "vendor", "common_source",
        "from", "extends", "implements")
    "constant" and listOf("false", "true", "null")
    "defineKeywords" and listOf("var", "var_input", "var_output", "var_in_out", "var_temp",
        "var_global", "var_access", "var_external", "end_var", "type", "end_type", "struct",
        "end_struct", "program", "end_program", "function", "end_function", "function_block",
        "end_function_block", "interface", "end_interface", "method", "end_method", "property",
        "end_property", "namespace", "end_namespace", "configuration", "end_configuration", "tcp",
        "end_tcp", "resource", "end_resource", "channel", "end_channel", "library", "end_library",
        "folder", "end_folder", "binaries", "end_binaries", "includes", "end_includes", "sources",
        "end_sources", "action", "end_action", "step", "initial_step", "end_step", "transaction",
        "end_transaction")
    typeKeywords("int", "sint", "dint", "lint", "usint", "uint", "udint", "ulint", "real", "lreal",
        "time", "date", "time_of_day", "date_and_time", "string", "bool", "byte", "word", "dword",
        "array", "pointer", "lword")
    operators("=", ">", "<", ":", ":=", "<=", ">=", "<>", "&", "+", "-", "*", "**", "MOD", "^",
        "or", "and", "not", "xor", "abs", "acos", "asin", "atan", "cos", "exp", "expt", "ln", "log",
        "sin", "sqrt", "tan", "sel", "max", "min", "limit", "mux", "shl", "shr", "rol", "ror",
        "indexof", "sizeof", "adr", "adrinst", "bitadr", "is_valid", "ref", "ref_to")
    "builtinVariables" and listOf()
    "builtinFunctions" and listOf("sr", "rs", "tp", "ton", "tof", "eq", "ge", "le", "lt", "ne",
        "round", "trunc", "ctd", "сtu", "ctud", "r_trig", "f_trig", "move", "concat", "delete",
        "find", "insert", "left", "len", "replace", "right", "rtc")
    symbols("[=>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy