#4927·antlr4

[New Grammar Request] UniBasic / UniVerse BASIC (Rocket U2 / Pick MultiValue)

Author: hdharmarathnaCreated Mar 12, 2026Updated Sep 24, 2026

Grammar Request: UniBasic / UniVerse BASIC

Language Overview

UniBasic (also called UniVerse BASIC) is the procedural programming language of the Rocket U2 platform (UniData and UniVerse), part of the Pick / MultiValue (MV) family of database systems. It is widely used in banking, distribution, manufacturing, healthcare, and government — many systems have been running unchanged since the 1980s.

UniVerse/UniData are still actively maintained by Rocket Software (2025), and the language is in daily production use at thousands of enterprise organizations worldwide.

Why This Grammar Is Needed

  • Legacy modernization: Thousands of organizations need to analyze, document, and migrate UniBasic codebases. A formal parser is essential for automated business rule extraction and code analysis.
  • No existing tool: There is no public ANTLR4 grammar for UniBasic. The existing basic/jvmBasic.g4 does NOT cover UniBasic — it lacks MV-specific constructs entirely.
  • Active community demand: The Rocket U2 developer community (community.rocketsoftware.com) and modernization tool vendors (e.g., BinaryStar MYRA) would benefit from a standard open grammar.

Key UniBasic Constructs Not in jvmBasic

UniBasic extends standard BASIC with MultiValue-specific syntax that requires new grammar rules:

Construct Example Purpose
Dynamic array extraction rec<3>, rec<3,2>, rec<3,2,1> Attribute/Value/SubValue access
MATREAD / MATWRITE MATREAD arr FROM file, key ELSE Matrix file I/O
LOCATE LOCATE val IN arr BY 'AL' SETTING pos ELSE MV array search
READU / READVU READU rec FROM file, key LOCKED WAIT Locked reads
REMOVE REMOVE element FROM arr SETTING delim Dynamic array iteration
$INCLUDE / $INSERT $INCLUDE EQUATES ACCT.EQUATES Compile-time include
EQUATE EQUATE BALANCE TO 3 Named constant declaration
BEGIN CASE / END CASE BEGIN CASE / CASE expr / END CASE Multi-branch
ON...GOSUB / ON...GOTO ON n GOSUB 100, 200, 300 Computed branch
COMMON blocks COMMON /NAME/ var1, var2 Shared variable blocks
OPEN / CLOSE OPEN 'ACCOUNTS' TO F.ACCT ELSE File handle management
WRITE / WRITEU WRITE rec TO F.ACCT, key File write
DELETE DELETE F.ACCT, key Record deletion
CLEARFILE CLEARFILE F.ACCT File clear

Reference Documentation

  • Rocket Software UniVerse BASIC Reference Manual (available at docs.rocketsoftware.com)
  • UniData Developers Reference
  • The language is case-insensitive and line-number optional (modern style)

Existing Related Grammar

basic/jvmBasic.g4 covers old-style line-numbered BASIC but is missing all of the MV-specific constructs listed above. A new grammar under basic/univbasic/ or multivalue/ would be more appropriate than extending jvmBasic.