// EqualityExpression := NotExpression '!=' S NotExpression private State DoParseEqualityExpression2Rule(State _state, List <Result> _outResults) { State _start = _state; List <Result> results = new List <Result>(); _state = DoSequence(_state, results, delegate(State s, List <Result> r) { return(DoParse(s, r, "NotExpression")); }, delegate(State s, List <Result> r) { return(DoParseLiteral(s, r, "!=")); }, delegate(State s, List <Result> r) { return(DoParse(s, r, "S")); }, delegate(State s, List <Result> r) { return(DoParse(s, r, "NotExpression")); }); if (_state.Parsed) { Predicate value = results.Count > 0 ? results[0].Value : default(Predicate); value = new NotEqualsPredicate(results[0].Value, results[2].Value); _outResults.Add(new Result(this, _start.Index, _state.Index - _start.Index, m_input, value)); } else { string expected; expected = "equality expression"; if (expected != null) { _state = new State(_start.Index, false, ErrorSet.Combine(_start.Errors, new ErrorSet(_state.Errors.Index, expected))); } } return(_state); }
private void InstallLocalPredicates() { // Input/Output _predicates["write/1"] = new WritePredicate(); _predicates["writeln/1"] = new WriteLnPredicate(); _predicates["nl/0"] = new NlPredicate(); _predicates["get0/1"] = new Get0Predicate(); _predicates["skip/1"] = new SkipPredicate(); _predicates["put/1"] = new PutPredicate(); // Comparison, numeric _predicates["=\\=/2"] = new NotEqualsPredicate(); _predicates["=:=/2"] = new EqualsPredicate(); _predicates[">=/2"] = new GreaterThanEqualPredicate(); _predicates[">/2"] = new GreaterThanPredicate(); _predicates["=</2"] = new LessThanEqualPredicate(); _predicates["</2"] = new LessThanPredicate(); // Control _predicates["call/1"] = new CallPredicate(); // Equality _predicates["=/2"] = new UnifyPredicate(); _predicates["\\=/2"] = new NotUnifiablePredicate(); // Meta _predicates["is/2"] = new IsPredicate(); _predicates["atom/1"] = new AtomPredicate(); _predicates["bound/1"] = new BoundPredicate(); _predicates["char/1"] = new CharPredicate(); _predicates["free/1"] = new FreePredicate(); _predicates["integer/1"] = new IntegerPredicate(); _predicates["nonvar/1"] = new NonVarPredicate(); _predicates["var/1"] = new VarPredicate(); // Object-Oriented Programming _predicates["object/2"] = new object_2(); _predicates["invoke/3"] = new invoke_2(); _predicates["get_property/3"] = new get_property_3(); // .NET Reflection }