private void BitwiseExpression(Stack<ExpressionOperation> operations)
{
if (Accept(TokenType.BitwiseNot))
{
Expression(operations);
operations.Push(new ExpressionOperation(TokenType.BitwiseNot));
}
else
Expression(operations);
while (AssemblyTokenizer.IsBitwiseOperation(tokens[pos].Type))
{
if (Accept(TokenType.BitwiseAnd))
{
Expression(operations);
operations.Push(new ExpressionOperation(TokenType.BitwiseAnd));
}
else if (Accept(TokenType.BitwiseOr))
{
Expression(operations);
operations.Push(new ExpressionOperation(TokenType.BitwiseOr));
}
else if (Accept(TokenType.BitwiseXor))
{
Expression(operations);
operations.Push(new ExpressionOperation(TokenType.BitwiseXor));
}
else
throw new AssemblerException("Expected bitwise operation.");
}
}