This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Property = obj:Variable | |
{ | |
PushStack([NSMutableArray array]); | |
} | |
- PropSubscr+ | |
{ | |
NSMutableArray *subscripts = PopStack(); | |
$$ = [TQNodeMemberAccess nodeWithReceiver:obj property:[subscript objectAtIndex:0]]; | |
for(int i = 1; i < [subscripts count]; ++i) { | |
$$ = [TQNodeMemberAccess nodeWithReceiver:$$ property:[subscript objectAtIndex:i]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sum = a:Product { PushStack(a); } | |
( - "+" - b:Product { ReplaceStackTop([TQNodeOperator nodeWithType:kTQOperatorAdd left:StackTop right:b]); } | |
| - "-" - b:Product { ReplaceStackTop([TQNodeOperator nodeWithType:kTQOperatorSubtract left:StackTop right:b]); } | |
)* { $$ = PopStack(); } | |
Product = a:Variable { PushStack(a); } | |
( - "*" - b:Product { ReplaceStackTop([TQNodeOperator nodeWithType:kTQOperatorMultiply left:StackTop right:b]); } | |
| - "/" - b:Product { ReplaceStackTop([TQNodeOperator nodeWithType:kTQOperatorDivide left:StackTop right:b]); } | |
)* { $$ = PopStack(); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (llvm::Value *)generateCodeInProgram:(TQProgram *)aProgram block:(TQNodeBlock *)aBlock error:(NSError **)aoErr | |
{ | |
IRBuilder<> *builder = aBlock.builder; | |
Module *mod = aProgram.llModule; | |
// Pose as the parent block for the duration of code generation | |
self.function = aBlock.function; | |
self.autoreleasePool = aBlock.autoreleasePool; | |
Value *testExpr = [_condition generateCodeInProgram:aProgram block:aBlock error:aoErr]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was autogenerated so don't modify it. | |
// (Compiled with support for up to 32 arguments) | |
#import <Tranquil/TQDebug.h> | |
#import <Tranquil/Runtime/TQRuntime.h> | |
// Passing the sentinel represents that no argument was passed for that slot | |
#define TQS TQSentinel | |
extern "C" { | |
id TQDispatchBlock0(struct TQBlockLiteral *block) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
@interface TQStackObject { | |
Class isa; | |
} | |
- (id)copy; | |
- (id)autoreleasedCopy; | |
- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Foo { | |
- init { | |
super init | |
print("foo") | |
^self | |
} | |
} | |
miniFoo = Foo new | |
print("%@", miniFoo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#import <Tranquil/Runtime/TQNumber.h> | |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
@interface TQStackObject { | |
Class isa; | |
@protected | |
id forwarding; // This points to the actual object (initially to itself) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
// the size needed for the batch, with proper alignment for objects | |
#define ALIGNMENT 8 | |
#define OBJECTS_PER_BUNCH 64 | |
#define BatchSize ((sizeof(TQBatch) + (ALIGNMENT - 1)) & ~(ALIGNMENT - 1)) | |
#define PoolSize 128 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct _va_list { | |
unsigned int gp_offset, fp_offset; | |
void *overflow_arg_area, *reg_save_area; | |
}; | |
int foo(int bar, ...) { | |
va_list lst; | |
va_start(lst, bar); | |
struct _va_list *list = &lst; | |
int *first = list->reg_save_area+list->gp_offset; | |
printf("%d\n", sizeof(int)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSPointerArray *TQVaargsToArray(va_list *items) | |
{ | |
register id arg; | |
NSPointerArray *arr = [NSPointerArray pointerArrayWithWeakObjects]; | |
while((arg = va_arg(*items, id)) != TQSentinel) { | |
[arr addPointer:arg]; | |
} | |
return arr; | |
} |