Skip to main content
Version: Next

SAS Parser

Parser Documentation

Version: 1.6.4

Generated on 2026/06/11.

Introduction

This parser is based on Starlasu Kotlin, an implementation of the StarLasu methodology on the Java Virtual Machine (JVM). The parser has been tested with JVM version 11. Issues related to serialization have been reported with later versions of the JVM starting with version 16.

How to Use a Kolasu Parser

The main entry point is the class com.strumenta.sas.parser.SASLanguage which is the SAS implementation of a Kolasu parser.

You can get a general overview of what you can do with Kolasu parsers, reading Building advanced parsers using Kolasu.

This is the basic code to run the SAS parser.

// register license
LicenseManager.INSTANCE.registerLicense(license);
// create parser
SASLanguage sasLanguage = new SASLanguage();
// activate parsing of SQL code
sasLanguage.setParseNativeSQL(true);
// obtain AST and any parsing issue
ParsingResult<SourceFile> result = sasLanguage.parse(sasFile);

After registering the licence, we build a SASLanguage instance and can invoke one of the parse method overloads to obtain a result including:

  • the AST, the main result of the parsing, a tree structure modeling the contents of the source code. This document lists the types of nodes that can make up the AST for SAS code. These are all Kolasu nodes that we can traverse, transform, etc. This is the __root __ property.
  • a list of issues encountered during parsing (errors, warnings, and informative messages). This is the issues property.

Packages