Q:

interpret everything after LeftBracket as a string until next RightBracket

[Solution]
on the bottom under Edit3
I am currently developring a new grammar (from certain requirements which I cannot change) and the following requirement poses a problem, I cannot solve at the moment. I am using Antlr4 with the C# target.
The syntax is as follows: 
print [blabla ]

so everything inside the brackets is considered a string. So also this:
print [3 + 2]

will print 
3 + 2

Now I have lexer rules which will obviously match the 3 as an Integer. So how can I create a parser rule which will parse anything until a ']' is found? I currently have the following production: 
control
: 
| Print expr
| Print LeftBracket printArg RightBracket
    ;

the problem I am facing is that the left bracket does not always start a string. Sometimes (eg in while) the condition is also in brackets. I thought about just accepting every Lexer rule until the RightBracket is reached and then generate the string at runtime when I use the generated parse tree, but seems to me very annoying and I would need to insert the whitespaces later on which will be difficult.
If you need more parts of my grammar just ask in a comment and I will provide you with more details
Kind regards
Lukas
EDIT: more information about my grammar:
The following production use brackets:
Print LeftBracket printArg RightBracket
Repeat IntegerConstant LeftBracket body RightBracket
While LeftBracket expr RightBracket LeftBracket body RightBracket
If expr LeftBracket body RightBracket LeftBracket body RightBracket
SetPos LeftBracket IntegerConstant IntegerConstant RightBracket

EDIT2:
So I tried to use the modes but I got problems on returning from them. These are the code lines I have regarding the modes:
mode printMode;
WhitespacePrint
    :   [ \t]+
        -> skip
    ;
LeftBracketPrint : '[' -> popMode, pushMode(stringMode);
NotLeftBracket : ~'[' -> popMode;

mode stringMode;
String : ~']'+;
RightBracketPrint: ']' -> popMode;

And I added a pushMode(printMode) on the Print lexer rule (matches the keyword)
Now parsing print [ 1 + 2] creates a single token containing the whole string inside the brackets. Now when I use print 1 + 2 (which should output 3), I get a no viable alternative ar input 'print1' exception, since the '1' has a type of NotLeftBracket. How can I switch the mode without consuming the input?
EDIT3:
Next I tried to use some inline code and use lookahead which finally solved my problem:
mode printMode;
LeftBracketPrint : [ \t]+ '[' -> popMode, pushMode(stringMode);
WhitespacePrint
    :   [ \t]+ {_input.La(1) != '['}?
        -> skip, popMode
    ;

mode stringMode;
String : ~']'+;
RightBracketPrint: ']' -> popMode;

A:

I would start by treating everything inside brackets as a BracketLiteral in the lexer.
LeftBracket : '[' -> pushMode(BracketLiteralMode);

mode BracketLiteralMode;

  BracketLiteral : ~']'+;
  RightBracket : ']' -> popMode;

Before determining how the special cases would be handled, I would then enumerate every last possibility for where an exception to the BracketLiteral rule could appear in the grammar. If you can add those details, I would be able to make some suggestions regarding how to handle those cases.

