コード例 #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
ファイル: HelpCommand.cs プロジェクト: akobr/texo.ui
        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
ファイル: Parser.cs プロジェクト: unycorn/lolcode-dot-net
 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);
 }