Skip to content

Commit

Permalink
chore(protobuf-parser): enhance message element handling and add debu…
Browse files Browse the repository at this point in the history
…g output #122
  • Loading branch information
phodal committed Oct 25, 2024
1 parent f9660f3 commit c71e51b
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ class ProtobufFullIdentListener(var fileName: String) : Protobuf3BaseListener()

/// since a message element will be all def
ctx.messageBody().messageElement().map {
/// : field
// | enumDef
// | messageDef
// | extendDef
// | optionStatement
// | oneof
// | mapField
// | reserved
when (val child = it.getChild(0)) {
is Protobuf3Parser.FieldContext -> {
codeDataStruct.Fields += CodeField(
Expand All @@ -39,6 +47,37 @@ class ProtobufFullIdentListener(var fileName: String) : Protobuf3BaseListener()
TypeValue = child.fieldNumber().text
)
}
is Protobuf3Parser.EnumDefContext -> {

}

is Protobuf3Parser.MessageDefContext -> {

}

is Protobuf3Parser.ExtendDefContext -> {

}

is Protobuf3Parser.OptionStatementContext -> {

}

is Protobuf3Parser.OneofContext -> {

}

is Protobuf3Parser.MapFieldContext -> {

}

is Protobuf3Parser.ReservedContext -> {

}

else -> {
println("Unknown message element: $child")
}
}
}
return codeDataStruct
Expand Down

0 comments on commit c71e51b

Please sign in to comment.