Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hxb parser

DISCLAIMER: the code (not the README) is AI generated using the Haxe compiler's ocaml HXB parser as reference.

We are using it as a frontend for hx2go. It should however be applicable for other projects that want a faster way to get Haxe's typed AST (not limited to eval/interp), while keeping all code in Haxe, such as other Haxe targets.

Requirements

Install

haxelib git hxb-parser github.com/go2hx/hxb-parser

Custom target

The sample code to implement a custom target, can be found at ./targetSample. Do note this is a lose generic reference implementation to how we implement hx2go, it's meant to be likewise used as a reference implementation and adapted for your own target's needs.

After you cd into the target sample you can run:

haxe build.hxml

This will run a new custom target haxe2 (made purely for demonstration purposes)

Look in ./targetSample/source/Context.hx for the majority of the code. The target gets setup with Haxe's custom target hook, by calling --custom-target haxe2=output in the build.hxml which looks for a file found at any source path that adheres to: [target]/Init.hx. Inside it defines a public static function init() using both Compiler.setPlatformConfiguration and Compiler.setHxbWriterConfiguration.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages