Skip to content

Commit 58c7a76

Browse files
committed
Set up the code to support unary builtin type specifiers
1 parent d55c77e commit 58c7a76

33 files changed

+1793
-1086
lines changed

packages/cxx-frontend/src/AST.ts

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9442,6 +9442,121 @@ export class BuiltinTypeSpecifierAST extends SpecifierAST {
94429442
}
94439443
}
94449444

9445+
/**
9446+
* UnaryBuiltinTypeSpecifierAST node.
9447+
*/
9448+
export class UnaryBuiltinTypeSpecifierAST extends SpecifierAST {
9449+
/**
9450+
* Traverse this node using the given visitor.
9451+
* @param visitor the visitor.
9452+
* @param context the context.
9453+
* @returns the result of the visit.
9454+
*/
9455+
accept<Context, Result>(
9456+
visitor: ASTVisitor<Context, Result>,
9457+
context: Context,
9458+
): Result {
9459+
return visitor.visitUnaryBuiltinTypeSpecifier(this, context);
9460+
}
9461+
9462+
/**
9463+
* Returns the location of the builtin token in this node
9464+
*/
9465+
getBuiltinToken(): Token | undefined {
9466+
return Token.from(cxx.getASTSlot(this.getHandle(), 0), this.parser);
9467+
}
9468+
9469+
/**
9470+
* Returns the location of the lparen token in this node
9471+
*/
9472+
getLparenToken(): Token | undefined {
9473+
return Token.from(cxx.getASTSlot(this.getHandle(), 1), this.parser);
9474+
}
9475+
9476+
/**
9477+
* Returns the typeId of this node
9478+
*/
9479+
getTypeId(): TypeIdAST | undefined {
9480+
return AST.from<TypeIdAST>(
9481+
cxx.getASTSlot(this.getHandle(), 2),
9482+
this.parser,
9483+
);
9484+
}
9485+
9486+
/**
9487+
* Returns the location of the rparen token in this node
9488+
*/
9489+
getRparenToken(): Token | undefined {
9490+
return Token.from(cxx.getASTSlot(this.getHandle(), 3), this.parser);
9491+
}
9492+
}
9493+
9494+
/**
9495+
* BinaryBuiltinTypeSpecifierAST node.
9496+
*/
9497+
export class BinaryBuiltinTypeSpecifierAST extends SpecifierAST {
9498+
/**
9499+
* Traverse this node using the given visitor.
9500+
* @param visitor the visitor.
9501+
* @param context the context.
9502+
* @returns the result of the visit.
9503+
*/
9504+
accept<Context, Result>(
9505+
visitor: ASTVisitor<Context, Result>,
9506+
context: Context,
9507+
): Result {
9508+
return visitor.visitBinaryBuiltinTypeSpecifier(this, context);
9509+
}
9510+
9511+
/**
9512+
* Returns the location of the builtin token in this node
9513+
*/
9514+
getBuiltinToken(): Token | undefined {
9515+
return Token.from(cxx.getASTSlot(this.getHandle(), 0), this.parser);
9516+
}
9517+
9518+
/**
9519+
* Returns the location of the lparen token in this node
9520+
*/
9521+
getLparenToken(): Token | undefined {
9522+
return Token.from(cxx.getASTSlot(this.getHandle(), 1), this.parser);
9523+
}
9524+
9525+
/**
9526+
* Returns the leftTypeId of this node
9527+
*/
9528+
getLeftTypeId(): TypeIdAST | undefined {
9529+
return AST.from<TypeIdAST>(
9530+
cxx.getASTSlot(this.getHandle(), 2),
9531+
this.parser,
9532+
);
9533+
}
9534+
9535+
/**
9536+
* Returns the location of the comma token in this node
9537+
*/
9538+
getCommaToken(): Token | undefined {
9539+
return Token.from(cxx.getASTSlot(this.getHandle(), 3), this.parser);
9540+
}
9541+
9542+
/**
9543+
* Returns the rightTypeId of this node
9544+
*/
9545+
getRightTypeId(): TypeIdAST | undefined {
9546+
return AST.from<TypeIdAST>(
9547+
cxx.getASTSlot(this.getHandle(), 4),
9548+
this.parser,
9549+
);
9550+
}
9551+
9552+
/**
9553+
* Returns the location of the rparen token in this node
9554+
*/
9555+
getRparenToken(): Token | undefined {
9556+
return Token.from(cxx.getASTSlot(this.getHandle(), 5), this.parser);
9557+
}
9558+
}
9559+
94459560
/**
94469561
* IntegralTypeSpecifierAST node.
94479562
*/
@@ -13444,6 +13559,8 @@ const AST_CONSTRUCTORS: Array<
1344413559
SizeTypeSpecifierAST,
1344513560
SignTypeSpecifierAST,
1344613561
BuiltinTypeSpecifierAST,
13562+
UnaryBuiltinTypeSpecifierAST,
13563+
BinaryBuiltinTypeSpecifierAST,
1344713564
IntegralTypeSpecifierAST,
1344813565
FloatingPointTypeSpecifierAST,
1344913566
ComplexTypeSpecifierAST,

packages/cxx-frontend/src/ASTKind.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ export enum ASTKind {
202202
SizeTypeSpecifier,
203203
SignTypeSpecifier,
204204
BuiltinTypeSpecifier,
205+
UnaryBuiltinTypeSpecifier,
206+
BinaryBuiltinTypeSpecifier,
205207
IntegralTypeSpecifier,
206208
FloatingPointTypeSpecifier,
207209
ComplexTypeSpecifier,

0 commit comments

Comments
 (0)