mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-09-15 14:49:58 +00:00
comment edits only
git-svn-id: http://cmock.svn.sourceforge.net/svnroot/cmock/trunk@132 bf332499-1b4d-0410-844d-d2d48d5cc64c
This commit is contained in:
@@ -24,7 +24,7 @@ grammar CMockFunctionPrototype
|
|||||||
|
|
||||||
rule argument_list
|
rule argument_list
|
||||||
# without a priori knowledge of all custom types (i.e. typedefs), the parser can only recognize
|
# without a priori knowledge of all custom types (i.e. typedefs), the parser can only recognize
|
||||||
# a list of primitives followed by an optional name or a single custom type followed by an optional name.
|
# a list of primitives followed by an optional name or a single custom type followed by an optional name.
|
||||||
# otherwise, there's no way to distinguish the last type in a list from a possibly non-existent argument name;
|
# otherwise, there's no way to distinguish the last type in a list from a possibly non-existent argument name;
|
||||||
# the rules in the grammar enforce this idea to ensure the parser fails rather than do something wonky
|
# the rules in the grammar enforce this idea to ensure the parser fails rather than do something wonky
|
||||||
left_paren arguments:( argument:argument (comma)? )* right_paren <ArgumentListNode>
|
left_paren arguments:( argument:argument (comma)? )* right_paren <ArgumentListNode>
|
||||||
@@ -79,7 +79,8 @@ grammar CMockFunctionPrototype
|
|||||||
rule type_primitive
|
rule type_primitive
|
||||||
# - at least one clause has to exist, not all can be '?' optional;
|
# - at least one clause has to exist, not all can be '?' optional;
|
||||||
# hence the long and int variations instead of an optional long followed by optional everything else
|
# hence the long and int variations instead of an optional long followed by optional everything else
|
||||||
# - !name_no_space limits matches to only primitives (allowing custom types to begin with primitive names)
|
# - !name_no_space limits matches to only primitives allowing custom types to be successfully
|
||||||
|
# recognized though their strings may begin with primitives (ex. integer value1, character value2)
|
||||||
(('unsigned' / 'signed') space_mandatory)?
|
(('unsigned' / 'signed') space_mandatory)?
|
||||||
(('long' space_mandatory 'int') / ('long' space_mandatory 'long') / 'long' / 'int' / 'short' / 'char' / 'float' / 'double') !name_no_space
|
(('long' space_mandatory 'int') / ('long' space_mandatory 'long') / 'long' / 'int' / 'short' / 'char' / 'float' / 'double') !name_no_space
|
||||||
type_const_and_ptr_suffix?
|
type_const_and_ptr_suffix?
|
||||||
@@ -101,9 +102,8 @@ grammar CMockFunctionPrototype
|
|||||||
end
|
end
|
||||||
|
|
||||||
rule lookahead_const
|
rule lookahead_const
|
||||||
# fancy lookahead statement that allows const type suffix to be distinguished
|
# fancy lookahead statement that allows const type suffix to be distinguished from a parameter
|
||||||
# from a parameter name that might begin with word 'const'
|
# name that might begin with word 'const' (ex. "int const_param" or "char* const constant")
|
||||||
# (ex. "int const_param" or "char* const constant")
|
|
||||||
'const' ( (space_mandatory &name) / (space_optional &comma) / (space_optional &right_paren) / (space_optional &left_paren) )
|
'const' ( (space_mandatory &name) / (space_optional &comma) / (space_optional &right_paren) / (space_optional &left_paren) )
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ grammar CMockFunctionPrototype
|
|||||||
end
|
end
|
||||||
|
|
||||||
rule void
|
rule void
|
||||||
# in reality, 'void' is something different than the 'void*' type so limit to 'void' here and handle 'void*' in type rule;
|
# in reality, 'void' is different than 'void*' type so limit to 'void' here and handle 'void*' in type rule;
|
||||||
# recognizing the VoidNode uniquely in programming is helpful
|
# recognizing the VoidNode uniquely in programming is helpful
|
||||||
'void' space_optional !asterisk <VoidNode>
|
'void' space_optional !asterisk <VoidNode>
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user