Getting startedGetting startedLanguageLanguageEvolutionEvolutionToolsTools
GitHubGitHub (opens in a new tab)
  • Guides
    • Type system
    • Functions
    • Statements
    • Message lifecycle
    • Send messages
    • Deploy contracts
    • Debugging
    • Contract upgrades
    • Masterchain
    • Compatibility with Func
    • Configuration
    • Programmatic API
    • Grammar
  • Reference
    • Common
    • Strings
    • Random
    • Math
    • Cells, Builders and Slices
    • Advanced
  • Libraries
    • @stdlib/deploy
    • @stdlib/ownable
    • @stdlib/stoppable
  • Getting started
    • Welcome to Tact
    • Writing your first contract
    • Deploying your contract
  • Language
    • Guides
      • Type system
      • Functions
      • Statements
      • Message lifecycle
      • Send messages
      • Deploy contracts
      • Debugging
      • Contract upgrades
      • Masterchain
      • Compatibility with Func
      • Configuration
      • Programmatic API
      • Grammar
    • Reference
      • Common
      • Strings
      • Random
      • Math
      • Cells, Builders and Slices
      • Advanced
    • Libraries
      • @stdlib/deploy
      • @stdlib/ownable
      • @stdlib/stoppable
  • Evolution
    • Evolution Process
    • OTP-001: Supported Interfaces
    • OTP-002: Contract ABI
    • OTP-003: Self-ABI reporting
    • OTP-004: Auto Encoder
    • OTP-005: Argument-addressable contracts
    • OTP-006: Contract Package
  • Tools
    • Typescript
    • VS Code Extension
Edit this page
Language
Guides
Grammar

Tact Grammar Files

Main Tact grammar is defined in OHM (opens in a new tab), but alternative grammars that are useful for editors are defined too.

Example of code highlight using current Textmate grammer:

import "@stdlib/ownable";
 
struct SampleStruct {
    message: Int as uint32;
}
 
message(0x1234) MyMessage {
    data: SampleStruct;
}
 
trait MyTrait {
    get fun traitState(): Int {
        return 0;
    }
}
 
contract MyContract with MyTrait, Ownable {
 
    owner: Address;
 
    init(owner: Address) {
        self.owner = owner;
    }
}
 
Programmatic APICommon

CC BY 4.0, Tact Software Foundation