private void ParseOwnSubroutineCall(SubroutineCallElement element) { element .Add(ParseIdentifier()) .Add(ParseSymbol(Symbols.OpeningBrace)) .Add(ParseOptional( ExpressionListParser.IsValid, ElementCategory.ExpressionList, new ExpressionListElement())) .Add(ParseSymbol(Symbols.ClosingBrace)); }
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)); }