Class: AdLint::Cc1::SyntaxNode
- Inherits:
-
Object
- Object
- AdLint::Cc1::SyntaxNode
- Includes:
- LocationHolder, Visitable
- Defined in:
- lib/adlint/cc1/syntax.rb
Overview
DESCRIPTION
SyntaxNode class hierarchy
SyntaxNode
<-- Expression
<-- ErrorExpression
<-- PrimaryExpression
<-- ObjectSpecifier
<-- ConstantSpecifier
<-- StringLiteralSpecifier
<-- NullConstantSpecifier
<-- GroupedExpression
<-- PostfixExpression
<-- ArraySubscriptExpression
<-- FunctionCallExpression
<-- MemberAccessByValueExpression
<-- MemberAccessByPointerExpression
<-- BitAccessByValueExpression
<-- BitAccessByPointerExpression
<-- PostfixIncrementExpression
<-- PostfixDecrementExpression
<-- CompoundLiteralExpression
<-- UnaryExpression
<-- PrefixIncrementExpression
<-- PrefixDecrementExpression
<-- AddressExpression
<-- IndirectionExpression
<-- UnaryArithmeticExpression
<-- SizeofExpression
<-- SizeofTypeExpression
<-- AlignofExpression
<-- AlignofTypeExpression
<-- CastExpression
<-- BinaryExpression
<-- MultiplicativeExpression
<-- AdditiveExpression
<-- ShiftExpression
<-- RelationalExpression
<-- EqualityExpression
<-- AndExpression
<-- ExclusiveOrExpression
<-- InclusiveOrExpression
<-- LogicalAndExpression
<-- LogicalOrExpression
<-- ConditionalExpression
<-- SimpleAssignmentExpression
<-- CompoundAssignmentExpression
<-- CommaSeparatedExpression
<-- Declaration
<-- FunctionDeclaration -------------------- SymbolicElement " <-- VariableDeclaration ----------------------+ | | | |\n <-- Definition | | | |\n <-- VariableDefinition --------------------+ | | |\n <-- PseudoVariableDefinition | | |\n <-- FunctionDefinition -----------------------+ | |\n <-- KandRFunctionDefinition | |\n <-- AnsiFunctionDefinition | |\n <-- ParameterDefinition | |\n <-- TypeDeclaration -----------------------------------+ |\n <-- TypedefDeclaration |\n <-- StructTypeDeclaration |\n <-- PseudoStructTypeDeclaration |\n <-- UnionTypeDeclaration |\n <-- PseudoUnionTypeDeclaration |\n <-- EnumTypeDeclaration |\n <-- PseudoEnumTypeDeclaration |\n <-- DeclarationSpecifiers |\n <-- InitDeclarator |\n <-- TypeSpecifier |\n <-- StandardTypeSpecifier |\n <-- TypedefTypeSpecifier |\n <-- StructSpecifier |\n <-- UnionSpecifier |\n <-- TypeofTypeSpecifier |\n <-- StructDeclaration |\n <-- MemberDeclaration |\n <-- SpecifierQualifierList |\n <-- StructDeclarator |\n <-- EnumSpecifier |\n <-- Enumerator -------------------------------------------+\n <-- Declarator\n <-- IdentifierDeclarator\n <-- GroupedDeclarator\n <-- ArrayDeclarator\n <-- FunctionDeclarator\n <-- AnsiFunctionDeclarator\n <-- KandRFunctionDeclarator\n <-- AbbreviatedFunctionDeclarator\n <-- AbstractDeclarator\n <-- PointerAbstractDeclarator\n <-- GroupedAbstractDeclarator\n <-- ArrayAbstractDeclarator\n <-- FunctionAbstractDeclarator\n <-- ParameterTypeList\n <-- ParameterDeclaration\n <-- Statement\n <-- ErrorStatement\n <-- LabeledStatement\n <-- GenericLabeledStatement\n <-- CaseLabeledStatement\n <-- DefaultLabeledStatement\n <-- CompoundStatement\n <-- ExpressionStatement\n <-- SelectionStatement\n <-- IfStatement\n <-- IfElseStatement\n <-- SwitchStatement\n <-- IterationStatement\n <-- WhileStatement\n <-- DoStatement\n <-- ForStatement\n <-- C99ForStatement\n <-- JumpStatement\n <-- GotoStatement\n <-- ContinueStatement\n <-- BreakStatement\n <-- ReturnStatement\n <-- TranslationUnit\n <-- TypeName\n <-- Initializer\n">>
Direct Known Subclasses
Declaration, DeclarationSpecifiers, Declarator, Definition, Enumerator, Expression, FunctionDeclaration, InitDeclarator, Initializer, MemberDeclaration, ParameterDeclaration, ParameterTypeList, SpecifierQualifierList, Statement, StructDeclaration, StructDeclarator, TranslationUnit, TypeDeclaration, TypeName, TypeSpecifier, VariableDeclaration
Instance Attribute Summary collapse
-
#head_token ⇒ Object
Returns the value of attribute head_token.
-
#subsequent_sequence_point ⇒ Object
readonly
Returns the value of attribute subsequent_sequence_point.
-
#tail_token ⇒ Object
Returns the value of attribute tail_token.
Instance Method Summary collapse
- #head_location ⇒ Object
-
#initialize ⇒ SyntaxNode
constructor
A new instance of SyntaxNode.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #short_class_name ⇒ Object
- #tail_location ⇒ Object
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize ⇒ SyntaxNode
Returns a new instance of SyntaxNode.
165 166 167 168 169 |
# File 'lib/adlint/cc1/syntax.rb', line 165 def initialize @head_token = nil @tail_token = nil @subsequent_sequence_point = nil end |
Instance Attribute Details
#head_token ⇒ Object
Returns the value of attribute head_token.
171 172 173 |
# File 'lib/adlint/cc1/syntax.rb', line 171 def head_token @head_token end |
#subsequent_sequence_point ⇒ Object (readonly)
Returns the value of attribute subsequent_sequence_point.
173 174 175 |
# File 'lib/adlint/cc1/syntax.rb', line 173 def subsequent_sequence_point @subsequent_sequence_point end |
#tail_token ⇒ Object
Returns the value of attribute tail_token.
172 173 174 |
# File 'lib/adlint/cc1/syntax.rb', line 172 def tail_token @tail_token end |
Instance Method Details
#head_location ⇒ Object
179 180 181 |
# File 'lib/adlint/cc1/syntax.rb', line 179 def head_location @head_token ? @head_token.location : nil end |
#inspect(indent = 0) ⇒ Object
187 188 189 |
# File 'lib/adlint/cc1/syntax.rb', line 187 def inspect(indent = 0) subclass_responsibility end |
#location ⇒ Object
175 176 177 |
# File 'lib/adlint/cc1/syntax.rb', line 175 def location subclass_responsibility end |
#short_class_name ⇒ Object
191 192 193 |
# File 'lib/adlint/cc1/syntax.rb', line 191 def short_class_name self.class.name.sub(/\A.*::/, "") end |
#tail_location ⇒ Object
183 184 185 |
# File 'lib/adlint/cc1/syntax.rb', line 183 def tail_location @tail_token ? @tail_token.location : nil end |