public AleTerm(AleTermType type, AleExpressionParser parser) { _Type = type; _Hash = 0; _Value = null; _Parent = null; _Token = null; _Elements = null; _Parser = parser; _Operation = null; }
public AleTerm() { _Type = AleTermType.Unknown; _Hash = 0; _Value = null; _Parent = null; _Token = null; _Elements = null; _Parser = null; _Operation = null; }
private void ShowError(AleExpressionParser AP) { //string err = AP.ErrorMessage() + " in line:" + AP.ErrorLine + " col:" + AP.ErrorCol + "\u000d\u000a"; string err = AP.ErrorMessage() + " at position " + AP.ErrorCol + "."; throw new Exception(err); //txtResult.Text = "Error '" + AP.ErrorMessage() + "' in line:" + AP.ErrorLine + " col:" + AP.ErrorCol + "\u000d\u000a"; //txtExpression.SelectionStart = AP.ErrorPosition; //txtExpression.SelectionLength = 1; //txtExpression.Focus(); }
private void OnSemanticsValidate(object sender, SemanticsValidateEventArgs e) { bool ignoreCase = AP.IgnoreCase; AleExpressionParser P = sender as AleExpressionParser; // We want for some reasons that "Rnd" can't be a variable name if ((e.Term.HashCode == -1028829980 && !ignoreCase && e.Term.Value.ToString() == "Rnd") || (e.Term.HashCode == 1843313028 && ignoreCase && e.Term.Value.ToString() == "RND")) { AleTerm parent = e.Term.Parent; if (e.Term.TypeOfTerm == AleTermType.Variable && (parent == null || parent.Operation == null || !parent.Operation.IsClassOperator || e.Term != parent[1])) { P.SetError(e.Term.Token.StartInOrigin, AleExpressionParser.ERROR_INVALIDVARIABLE); } } }
private void ShowError(AleExpressionParser AP) { txtResult.Text = "Error '" + AP.ErrorMessage() + "' en la linea:" + AP.ErrorLine + " col:" + AP.ErrorCol + "\u000d\u000a"; txtExpression.SelectionStart = AP.ErrorPosition; txtExpression.SelectionLength = 1; txtExpression.Focus(); }