/* * blockStatement * : localVariableDeclarationStatement | classOrInterfaceDeclaration | statement | ; | statement | : block | ';' | IDENTIFIER ':' statement | expression ';' | ... (snip) ... | ; */ public IEnumerable <CstNode> SelectStatements(CstNode e) { var blockStatements = e.Descendants("blockStatement") .Where(e_ => IsVariableDeclaration(e_) || IsClassDeclaration(e_)); var statements = e.Descendants("statement") .Where( e_ => !IsBlockStatement(e_) && !IsEmptyStatement(e_) && !IsLabeledStatement(e_)); return(blockStatements.Concat(statements)); }
public IEnumerable <CstNode> SelectBooleanExpressions(CstNode e) { var expressions = e.Descendants("expression") .Where( e_ => IsIf(e_) || IsWhile(e_) || IsDoWhile(e_) || IsFor(e_) || IsCheckArgument(e_)) .Where(e_ => !IsChild(e_, IsCatchBlock)); return(expressions); }
/* blockStatement : localVariableDeclarationStatement | classOrInterfaceDeclaration | statement ; statement : block | ';' | IDENTIFIER ':' statement | expression ';' | ... (snip) ... ; */ public IEnumerable<CstNode> SelectStatements(CstNode e) { var blockStatements = e.Descendants("blockStatement") .Where(e_ => IsVariableDeclaration(e_) || IsClassDeclaration(e_)); var statements = e.Descendants("statement") .Where( e_ => !IsBlockStatement(e_) && !IsEmptyStatement(e_) && !IsLabeledStatement(e_)); return blockStatements.Concat(statements); }
public IEnumerable<CstNode> SelectBooleanExpressions(CstNode e) { var expressions = e.Descendants("expression") .Where( e_ => IsIf(e_) || IsWhile(e_) || IsDoWhile(e_) || IsFor(e_) || IsCheckArgument(e_)) .Where(e_ => !IsChild(e_, IsCatchBlock)); return expressions; }