I want to create a very simple grammar with space indentation. Each line consists of 1 or more words but indentation like python (4 spaces or a tab is one indent) and there is no close for indentation, for example:
if something cool occurs
do this
else
otherwise do this
loop around something
each time doing this
and do that
say good byte
Rather than read each line, calculate the indentation and build a tree manually is it possible to do all of that in ANTLR grammar? My target language is Java.