public void Run(AstUseInheritanceStatement statement)
        {
#if DEBUG
            //Log($"statement = {statement}");
#endif

            CompileValue(statement.SubName);
            CompileValue(statement.SuperName);
            CompileValue(statement.Rank);

            var command = new IntermediateScriptCommand();
            command.OperationCode = OperationCode.PushVal;
            command.Value         = statement.GetAnnotationValue();

            AddCommand(command);

            command = new IntermediateScriptCommand();

            if (statement.HasNot)
            {
                command.OperationCode = OperationCode.UseNotInheritance;
            }
            else
            {
                command.OperationCode = OperationCode.UseInheritance;
            }

            AddCommand(command);

            AddCommand(new IntermediateScriptCommand()
            {
                OperationCode = OperationCode.ClearStack
            });
        }
예제 #2
0
        private void CreateAstUseInheritanceStatement()
        {
            var result = new AstUseInheritanceStatement();

            DefaultSettingsOfCodeEntityHelper.SetUpAnnotatedItem(result, CurrentDefaultSetings);

            result.AppendAnnotations(_rawStatement);

            result.SubName   = _rawStatement.FirstName;
            result.SuperName = _rawStatement.SecondName;

            if (_rawStatement.Rank == null)
            {
                result.Rank = new LogicalValue(1);
            }
            else
            {
                result.Rank = _rawStatement.Rank;
            }

            result.HasNot = _rawStatement.HasNot;

            Result = result;
        }