import lexer_example

@with_lexer(foo_lexer)
grammar foo_grammar {
    @main_rule stmt_rule <- list*(DerivedNode("def" name))
    name <- Name(@identifier)
}

class FooNode implements Node[FooNode] {
}

@abstract
class DerivedNode : FooNode {
}

class Def : DerivedNode {
    @parse_field name: Name
}

class Name : FooNode implements TokenNode {
}
