コード例 #1
0
 private void ParseOwnSubroutineCall(SubroutineCallElement element)
 {
     element
     .Add(ParseIdentifier())
     .Add(ParseSymbol(Symbols.OpeningBrace))
     .Add(ParseOptional(
              ExpressionListParser.IsValid,
              ElementCategory.ExpressionList,
              new ExpressionListElement()))
     .Add(ParseSymbol(Symbols.ClosingBrace));
 }
コード例 #2
0
        public override ParseResult Parse()
        {
            var element = new SubroutineCallElement();

            if (Tokens.ElementAt(1).Value == Symbols.OpeningBrace)
            {
                ParseOwnSubroutineCall(element);
            }
            else
            {
                ParseExternalSubroutineCall(element);
            }

            return(new ParseResult(ConsumedTokensCount, element));
        }