Skip to content

Custom language grammar usage question #45

@ghost

Description

Hello,

This may be obvious after reading the docs, but I am having issues figuring out how to use this tool for a custom language grammar. Is it as simple as importing the compiled codebuff .JAR and calling the following:

org.antlr.codebuff.Tool.format(new org.antlr.codebuff.misc.LangDescriptor("MyLang",
                                        "corpus/path/to/mylang/examples",
                                        ".mylang", MyLangLexer.class, MyLangParser.class, "mylang_file", 4,
                                        MyLang.LINE_COMMENT),
                                        "source.mylang",
                                        "destination.mylang");

This does format and output to my destination file, but it looks nothing like the example files.

Or do I need to train the model for my language in the codebuff project?

Any help is appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions