Catspeak Reference


struct CatspeakParser

GameMaker Language (.gml)
Copyfunction CatspeakParser( lexer : Struct.CatspeakLexer, builder : Struct.CatspeakIRBuilder, ) constructor { // 3 fields omitted }
🔬 This is an experimental feature. It may change at any moment.

Consumes tokens produced by a CatspeakLexer, transforming the program they represent into Catspeak IR. This Catspeak IR can be further compiled down into a callable GML function using CatspeakGMLCompiler.

Arguments

  • lexer

    The lexer to consume tokens from.

  • builder

    The Catspeak IR builder to write the program to.

§ updatetop ^

GameMaker Language (.gml)
Copystatic update = function() -> Bool

Parses a top-level Catspeak statement from the supplied lexer, adding any relevant parse information to the supplied IR.

Returns Bool

true if there is still more data left to parse, and false if the parser has reached the end of the file.

Example

Creates a new CatspeakParser from the variables lexer and builder, then loops until there is nothing left to parse.

GameMaker Language (.gml)
Copyvar parser = new CatspeakParser(lexer, builder); var moreToParse; do { moreToParse = parser.update(); } until (!moreToParse);