From 328ad7664db4453de412b3e32cf0320ea84542b2 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 22 Oct 2009 07:31:38 +0000 Subject: [PATCH] Further factored out Objective-C aspects of Cycript grammar and fixed dylib->$(dll). --- Cycript.y.in | 48 ++++++++++++++++++++++++++---------------------- makefile | 8 ++++---- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/Cycript.y.in b/Cycript.y.in index 0823b7a..4d47834 100644 --- a/Cycript.y.in +++ b/Cycript.y.in @@ -63,7 +63,6 @@ typedef struct { CYBoolean *boolean_; CYClause *clause_; CYCatch *catch_; - CYClassName *className_; CYComprehension *comprehension_; CYCompound *compound_; CYDeclaration *declaration_; @@ -71,7 +70,6 @@ typedef struct { CYElement *element_; CYExpression *expression_; CYFalse *false_; - CYField *field_; CYFinally *finally_; CYForInitialiser *for_; CYForInInitialiser *forin_; @@ -92,6 +90,8 @@ typedef struct { CYWord *word_; @begin ObjC + CYClassName *className_; + CYField *field_; CYMessage *message_; CYMessageParameter *messageParameter_; CYSelectorPart *selector_; @@ -304,15 +304,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner); %type CaseClause %type CaseClausesOpt %type CatchOpt -%type CategoryStatement -%type ClassExpression -%type ClassMessageDeclaration -%type ClassMessageDeclarationListOpt -%type ClassName -%type ClassNameOpt -%type ClassStatement -%type ClassSuperOpt -%type ClassFieldList %type ComprehensionList %type ComprehensionListOpt %type ConditionalExpression @@ -373,11 +364,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner); %type MemberExpression %type MemberExpression_ %type MemberExpressionNoBF -%type MessageParameter -%type MessageParameters -%type MessageParameterList -%type MessageParameterListOpt -%type MessageScope %type MultiplicativeExpression %type MultiplicativeExpressionNoBF %type NewExpression @@ -403,9 +389,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner); %type RelationalExpressionNoIn %type RelationalExpressionNoIn_ %type ReturnStatement -%type SelectorExpression -%type SelectorExpression_ -%type SelectorExpressionOpt %type ShiftExpression %type ShiftExpressionNoBF %type SourceElement @@ -417,7 +400,6 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner); %type SwitchStatement %type ThrowStatement %type TryStatement -%type TypeOpt %type UnaryExpression %type UnaryExpression_ %type UnaryExpressionNoBF @@ -430,14 +412,34 @@ int cylex(YYSTYPE *lvalp, cy::location *llocp, void *scanner); %type VariableStatement %type WhileStatement %type WithStatement -%type Word -%type WordOpt +@begin ObjC +%type CategoryStatement +%type ClassExpression +%type ClassStatement +%type ClassSuperOpt +%type ClassFieldList +%type ClassMessageDeclaration +%type ClassMessageDeclarationListOpt +%type ClassName +%type ClassNameOpt %type MessageExpression +%type MessageParameter +%type MessageParameters +%type MessageParameterList +%type MessageParameterListOpt +%type MessageScope %type SelectorCall %type SelectorCall_ +%type SelectorExpression +%type SelectorExpression_ +%type SelectorExpressionOpt %type SelectorList +%type TypeOpt %type VariadicCall +%type Word +%type WordOpt +@end %left "*" "/" "%" %left "+" "-" @@ -483,6 +485,7 @@ Terminator | ;*/ +@begin ObjC NewLineOpt : "\n" | @@ -532,6 +535,7 @@ Word | "while" { $$ = $1; } | "with" { $$ = $1; } ; +@end Identifier : Identifier_ { $$ = $1; } diff --git a/makefile b/makefile index 99ef08d..8b4711b 100644 --- a/makefile +++ b/makefile @@ -50,9 +50,9 @@ $(deb): $(all) cp -a Settings.plist package/Library/PreferenceLoader/Preferences/Cycript.plist; \ fi if [[ -e Tweak.plist ]]; then cp -a Tweak.plist package/Library/MobileSubstrate/DynamicLibraries/Cycript.plist; fi - cp -a Cycript.dylib package/Library/MobileSubstrate/DynamicLibraries + cp -a Cycript.$(dll) package/Library/MobileSubstrate/DynamicLibraries mkdir -p package/usr/{bin,lib,sbin} - cp -a libcycript.dylib package/usr/lib + cp -a libcycript.$(dll) package/usr/lib cp -a cycript package/usr/bin #cp -a cyrver package/usr/sbin cp -a libcycript.plist package/usr/lib @@ -62,7 +62,7 @@ endif all: $(all) clean: - rm -f *.o libcycript.dylib cycript libcycript.plist Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh cyrver + rm -f *.o libcycript.$(dll) cycript libcycript.plist Struct.hpp lex.cy.c Cycript.tab.cc Cycript.tab.hh location.hh position.hh stack.hh cyrver Cycript.y libcycript.plist: Bridge.def { \ @@ -110,7 +110,7 @@ cyrver: Server.o libcycript.$(dll): $(code) $(target)g++ $(flags) -dynamiclib -o $@ $(filter %.o,$^) \ - -install_name /usr/lib/libcycript.dylib \ + -install_name /usr/lib/libcycript.$(dll) \ -lobjc -lapr-1 -lffi -lsubstrate \ -framework CoreFoundation -framework Foundation \ -framework CFNetwork \ -- 2.45.2