private bool ParseAssignment(string text, out IRValueNode leftOperand, out IRValueNode rightOperand) {
leftOperand = null;
rightOperand = null;
// Parse the expression
var ast = RParser.Parse(text);
if (ast.Errors.Count == 0) {
// Expected 'Variable <- Expression'
var scope = ast.Children[0] as GlobalScope;
if (scope?.Children.Count > 0) {
var exp = (scope.Children[0] as IExpressionStatement)?.Expression;
if (exp?.Children.Count == 1) {
var op = exp.Children[0] as IOperator;
if (op != null) {
if (op.OperatorType == OperatorType.LeftAssign && op.LeftOperand != null && op.RightOperand != null) {
leftOperand = op.LeftOperand;
rightOperand = op.RightOperand;
return true;
}
}
}
}
}
return false;
}