GBParser Class Reference
Inherits from | NSObject |
Declared in | GBParser.h GBParser.m |
Overview
Handles loading class data from source files.
This is the first phase of appledoc generation process. It walks the given directory hierarchy and loads source files data into memory structure prepared for next phases.
Tasks
Initialization & disposal
-
+ parserWithSettingsProvider:
Returns autoreleased parser that work with the givenGBApplicationSettingsProvider
implementor. -
– initWithSettingsProvider:
Initializes the parser to work with the givenGBApplicationSettingsProvider
implementor.
Parsing handling
-
– parseObjectsFromPaths:toStore:
Scans the given array of paths and parses all code files into in-memory objects.
Class Methods
parserWithSettingsProvider:
Returns autoreleased parser that work with the given GBApplicationSettingsProvider
implementor.
+ (id)parserWithSettingsProvider:(id)settingsProvider
Parameters
- settingsProvider
- Application-wide settings provider to use for checking parameters.
Return Value
Returns initialized instance or nil
if initialization fails.
Exceptions
- NSException
- Thrown if the given application is
nil
.
Declared In
GBParser.h
Instance Methods
initWithSettingsProvider:
Initializes the parser to work with the given GBApplicationSettingsProvider
implementor.
- (id)initWithSettingsProvider:(id)settingsProvider
Parameters
- settingsProvider
- Application-wide settings provider to use for checking parameters.
Return Value
Returns initialized instance or nil
if initialization fails.
Discussion
This is the designated initializer.
Exceptions
- NSException
- Thrown if the given application is
nil
.
Declared In
GBParser.h
parseObjectsFromPaths:toStore:
Scans the given array of paths and parses all code files into in-memory objects.
- (void)parseObjectsFromPaths:(NSArray *)paths toStore:(id)store
Parameters
- paths
- An array of strings representing paths to parse.
- store
- The store to add objects to.
Discussion
This is the main parsing method. It is intended to be invoked from the top level application code. It accepts an array of paths - either directories or file names - and parses them for code. If it detects an object within any file, it's data is parsed into in-memory representation suited for further processing. Parsed data is registered to the given GBStore
.
If any kind of inconsistency is detected in source code, a warning is logged and parsing continues. This allows us to extract as much information as possible, while ignoring problems.
Note: The method expects the given array contains NSString
s representing existing directory or file names. The method itself doesn't validate this and may result in unpredictable behavior in case an invalid path is passed in. The paths don't have to be standardized, expanded or similar though.
Exceptions
- NSException
- Thrown if a serious problem is detected which prevents us from parsing.
Declared In
GBParser.h