示例#1
0
        void GimmehStatement(out Statement stat)
        {
            InputStatement ins = new InputStatement(GetPragma(la)); stat = ins;

            Expect(24);
            if (la.kind == 25 || la.kind == 26 || la.kind == 27)
            {
                if (la.kind == 25)
                {
                    Get();
                }
                else if (la.kind == 26)
                {
                    Get();
                    ins.amount = IOAmount.Word;
                }
                else
                {
                    Get();
                    ins.amount = IOAmount.Letter;
                }
            }
            LValue(out ins.dest);
            SetEndPragma(stat);
        }
示例#2
0
        private void RenderRepresentation(InputStatement statement, params string[] exceptedRepresentations)
        {
            if (statement.Representations.Count <= exceptedRepresentations.Length)
            {
                return;
            }

            result.Append('(');

            HashSet <string> exceptions = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

            foreach (string excepted in exceptedRepresentations)
            {
                exceptions.Add(excepted);
            }

            foreach (string representation in statement.Representations)
            {
                if (exceptions.Contains(representation))
                {
                    continue;
                }

                result.Append(representation);
                result.Append(", ");
            }

            result.Remove(result.Length - 2, 2);
            result.Append(')');
        }
示例#3
0
        public override string VisitInputStatement(BasicParser.InputStatementContext context)
        {
            var variableName   = context.VARNAME().ToString();
            var inputStatement = new InputStatement(variableName);

            Statements[_currentLineNumber] = inputStatement;

            return(base.VisitInputStatement(context));
        }
示例#4
0
        private static IBlock BuildParametersSection(InputStatement statement)
        {
            Section result = new Section(new Header("Parameters"));

            foreach (Parameter parameter in statement.Parameters)
            {
                result = result.AddChild(BuildParameterInfo(parameter));
            }

            return(result);
        }
示例#5
0
 void GimmehStatement(out Statement stat)
 {
     InputStatement ins = new InputStatement(GetPragma(la)); stat = ins;
     Expect(24);
     if (la.kind == 25 || la.kind == 26 || la.kind == 27) {
     if (la.kind == 25) {
         Get();
     } else if (la.kind == 26) {
         Get();
         ins.amount = IOAmount.Word;
     } else {
         Get();
         ins.amount = IOAmount.Letter;
     }
     }
     LValue(out ins.dest);
     SetEndPragma(stat);
 }