Scripting Overview

C# scripts can be used for extending Igor Code generation capabilities. By default you can use C# 4.0. Modern C# versions can be used with a Roslyn compiler.

See Script Compilation for details on how to provide C# scripts to the Igor Compiler application and how to use Roslyn.

See Use Visual Studio to edit extension scripts to learn how to edit and debug your scripts with Visual Studio.

See also

API Reference

Script Execution Model

The result of parsing Igor files is called a syntax tree (AST). It is a tree representation of source Igor files.

Syntax tree is not directly translated into a target language code. Instead, an intermediate target model is generated first. A target model contains high level declarations of the target language (e.g. modules, classes, class members, etc.). That allows target language declarations to be easily extendible (new classes can be added to a module, new properties and functions can be added to a class, etc.). Only after the target model is built, text rendering is performed and target language code files are generated.

Scripting Model

The process of building the target model can be extended using extension scripts. Extension script generators are executed after built-in generators, so that scripts can modify any declarations generated by the built-in generators.