コード例 #1
0
        public override LogicalOperation VisitIdentifier(LogicalGrammarParser.IdentifierContext context)
        {
            string id = context.GetText();

            if (Variables.ContainsKey(id))
            {
                return(new LogicalVariableUsage(Variables[id]));
            }
            var variable = new LogicalVariable(id);

            Variables.Add(id, variable);
            return(new LogicalVariableUsage(variable));
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            LogicalVariable other = (LogicalVariable)obj;

            if (variableName != null ? !variableName.Equals(other.variableName) : other.variableName != null)
            {
                return(false);
            }

            return(true);
        }
コード例 #3
0
        public override void ExitLogicalVariable([NotNull] RuleSetGrammarParser.LogicalVariableContext context)
        {
            LogicalVariable variable = new LogicalVariable(context.GetText());

            this.logicalExpressions.Push(variable);
        }