Skip to content

Commit

Permalink
Update pbxproj def (#37)
Browse files Browse the repository at this point in the history
* Improve grammar to include some uncovered cases

I was experiencing some false positives due to some strange REFERENCE
values. These were group and xcconfig file references, prefixed with a
G_ or FR_ string. I'm now covering these scenarios and added a new test
where these appear to make sure we don't fall into the same problem
again.

* Add inputFileListPaths and outputFileListPaths rules

* Add a new valid pbxproj test from the community

Add a new rule for outputPaths that can be quoted strings

* Add a new rule for the new DefaultBuildSystemTypeForWorkspace property
  • Loading branch information
Serchinastico authored Nov 15, 2019
1 parent 0738527 commit f464121
Show file tree
Hide file tree
Showing 11 changed files with 5,609 additions and 2,500 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ target/

#Ipython Notebook
.ipynb_checkpoints

# ANTLR
.antlr
18 changes: 17 additions & 1 deletion kin/grammar/PBXProj.g4
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,10 @@ pbx_shell_script_build_phase
isa_pbx_shell_script_build_phase
build_action_mask
files
input_file_list_paths?
input_paths
name?
output_file_list_paths?
output_paths
run_only_for_deployment_postprocessing
shell_path
Expand Down Expand Up @@ -560,6 +562,7 @@ xc_language_specification_identifier
attributes
: 'attributes' '=' '{'
class_prefix?
default_build_system_type_for_workspace?
last_swift_migration?
last_swift_update_check?
last_upgrade_check
Expand All @@ -573,6 +576,10 @@ last_swift_migration
: 'LastSwiftMigration' '=' NON_QUOTED_STRING ';'
;

default_build_system_type_for_workspace
: 'DefaultBuildSystemTypeForWorkspace' '=' NON_QUOTED_STRING ';'
;

last_swift_update_check
: 'LastSwiftUpdateCheck' '=' NON_QUOTED_STRING ';'
;
Expand Down Expand Up @@ -662,12 +669,20 @@ targets
: 'targets' '=' reference_list ';'
;

input_file_list_paths
: 'inputFileListPaths' '=' any_string_list ';'
;

input_paths
: 'inputPaths' '=' any_string_list ';'
;

output_file_list_paths
: 'outputFileListPaths' '=' any_string_list ';'
;

output_paths
: 'outputPaths' '=' non_quoted_strings_list ';'
: 'outputPaths' '=' any_string_list ';'
;

shell_path
Expand Down Expand Up @@ -789,6 +804,7 @@ REFERENCE
HEX HEX HEX HEX
HEX HEX HEX HEX
HEX HEX HEX HEX
| ('FR_'|'G_') (HEX)+
;

QUOTED_STRING
Expand Down
128 changes: 67 additions & 61 deletions kin/grammar/PBXProj.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,22 @@ T__95=96
T__96=97
T__97=98
T__98=99
ARCHIVE_VERSION=100
CLASSES=101
ISA=102
OBJECT_VERSION=103
OBJECTS=104
ROOT_OBJECT=105
REFERENCE=106
QUOTED_STRING=107
NON_QUOTED_STRING=108
VARIABLE=109
WS=110
COMMENT=111
LINE_COMMENT=112
T__99=100
T__100=101
T__101=102
ARCHIVE_VERSION=103
CLASSES=104
ISA=105
OBJECT_VERSION=106
OBJECTS=107
ROOT_OBJECT=108
REFERENCE=109
QUOTED_STRING=110
NON_QUOTED_STRING=111
VARIABLE=112
WS=113
COMMENT=114
LINE_COMMENT=115
'{'=1
'}'=2
'='=3
Expand Down Expand Up @@ -167,51 +170,54 @@ LINE_COMMENT=112
'xcLanguageSpecificationIdentifier'=55
'attributes'=56
'LastSwiftMigration'=57
'LastSwiftUpdateCheck'=58
'LastUpgradeCheck'=59
'LastTestingUpgradeCheck'=60
'ORGANIZATIONNAME'=61
'TargetAttributes'=62
'CreatedOnToolsVersion'=63
'TestTargetID'=64
'DevelopmentTeam'=65
'ProvisioningStyle'=66
'compatibilityVersion'=67
'developmentRegion'=68
'hasScannedForEncodings'=69
'knownRegions'=70
'mainGroup'=71
'productRefGroup'=72
'projectDirPath'=73
'projectReferences'=74
'projectRoot'=75
'targets'=76
'inputPaths'=77
'outputPaths'=78
'shellPath'=79
'shellScript'=80
'showEnvVarsInLog'=81
'target'=82
'targetProxy'=83
'fileType'=84
'remoteRef'=85
'baseConfigurationReference'=86
'buildSettings'=87
'dstPath'=88
'dstSubfolderSpec'=89
'ProductGroup'=90
'ProjectRef'=91
'buildConfigurations'=92
'defaultConfigurationIsVisible'=93
'defaultConfigurationName'=94
'settings'=95
'SystemCapabilities'=96
'currentVersion'=97
'versionGroupType'=98
'CLASSPREFIX'=99
'archiveVersion'=100
'classes'=101
'isa'=102
'objectVersion'=103
'objects'=104
'rootObject'=105
'DefaultBuildSystemTypeForWorkspace'=58
'LastSwiftUpdateCheck'=59
'LastUpgradeCheck'=60
'LastTestingUpgradeCheck'=61
'ORGANIZATIONNAME'=62
'TargetAttributes'=63
'CreatedOnToolsVersion'=64
'TestTargetID'=65
'DevelopmentTeam'=66
'ProvisioningStyle'=67
'compatibilityVersion'=68
'developmentRegion'=69
'hasScannedForEncodings'=70
'knownRegions'=71
'mainGroup'=72
'productRefGroup'=73
'projectDirPath'=74
'projectReferences'=75
'projectRoot'=76
'targets'=77
'inputFileListPaths'=78
'inputPaths'=79
'outputFileListPaths'=80
'outputPaths'=81
'shellPath'=82
'shellScript'=83
'showEnvVarsInLog'=84
'target'=85
'targetProxy'=86
'fileType'=87
'remoteRef'=88
'baseConfigurationReference'=89
'buildSettings'=90
'dstPath'=91
'dstSubfolderSpec'=92
'ProductGroup'=93
'ProjectRef'=94
'buildConfigurations'=95
'defaultConfigurationIsVisible'=96
'defaultConfigurationName'=97
'settings'=98
'SystemCapabilities'=99
'currentVersion'=100
'versionGroupType'=101
'CLASSPREFIX'=102
'archiveVersion'=103
'classes'=104
'isa'=105
'objectVersion'=106
'objects'=107
'rootObject'=108
Loading

0 comments on commit f464121

Please sign in to comment.