A list of Elements separated or terminated by a fixed token. More...
#include "clang/Tooling/Syntax/Tree.h"
A list of Elements separated or terminated by a fixed token.
This type models the following grammar construct: delimited-list(element, delimiter, termination, canBeEmpty)
Definition at line 254 of file Tree.h.
◆ TerminationKind Enumerator Terminated MaybeTerminated SeparatedDefinition at line 261 of file Tree.h.
◆ canBeEmpty() bool syntax::List::canBeEmpty ( ) constWhether this list can be empty in syntactically and semantically correct code.
This list may be empty when the source code has errors even if canBeEmpty() returns false.
Definition at line 427 of file Tree.cpp.
References getKind().
◆ classof() static bool clang::syntax::List::classof ( const Node * N ) static ◆ getDelimiterTokenKind()Returns the appropriate delimiter for this list.
Useful for discovering the correct delimiter to use when adding elements to empty or one-element lists.
Definition at line 399 of file Tree.cpp.
References getKind().
◆ getElementsAsNodes() std::vector< syntax::Node * > syntax::List::getElementsAsNodes ( ) ◆ getElementsAsNodesAndDelimiters()Returns the elements and corresponding delimiters.
Missing elements and delimiters are represented as null pointers.
For example, in a separated list: "a, b, c" <=> [("a" , ","), ("b" , "," ), ("c" , null)] "a, , c" <=> [("a" , ","), (null, "," ), ("c" , null)] "a, b c" <=> [("a" , ","), ("b" , null), ("c" , null)] "a, b," <=> [("a" , ","), ("b" , "," ), (null, null)]
In a terminated or maybe-terminated list: "a; b; c;" <=> [("a" , ";"), ("b" , ";" ), ("c" , ";" )] "a; ; c;" <=> [("a" , ";"), (null, ";" ), ("c" , ";" )] "a; b c;" <=> [("a" , ";"), ("b" , null), ("c" , ";" )] "a; b; c" <=> [("a" , ";"), ("b" , ";" ), ("c" , null)]
Definition at line 312 of file Tree.cpp.
References clang::C, clang::syntax::ListDelimiter, clang::syntax::ListElement, MaybeTerminated, Separated, and Terminated.
◆ getTerminationKind()The documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4