Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
f138b8f3
Commit
f138b8f3
authored
May 21, 2013
by
Oleg Batrashev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prototype scan for function, does not yet catch parameter types.
parent
3e8a7fbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
+35
-2
fortranscanner.l
src/fortranscanner.l
+35
-2
No files found.
src/fortranscanner.l
View file @
f138b8f3
...
...
@@ -187,6 +187,7 @@ static InterfaceType ifType = IF_NONE;
static bool functionLine = FALSE;
static char stringStartSymbol; // single or double quote
static bool parsingPrototype = FALSE; // see parsePrototype()
//! Accumulated modifiers of current statement, eg variable declaration.
static SymbolModifiers currentModifiers;
...
...
@@ -307,6 +308,12 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA
%x EndDoc
%x BlockData
/** prototype parsing */
%x Prototype
%x PrototypeSubprog
%x PrototypeArgs
%%
/*-----------------------------------------------------------------------------------*/
...
...
@@ -1099,6 +1106,23 @@ private {
yy_pop_state();
}
/*-----Prototype parsing -------------------------------------------------------------------------*/
<Prototype>{BS}{SUBPROG}{BS_} {
BEGIN(PrototypeSubprog);
}
<PrototypeSubprog>{ID}{BS} { current->name = yytext;
current->name.stripWhiteSpace();
BEGIN(PrototypeArgs);
}
<PrototypeArgs>{
"("|")"|","|{BS_} { current->args += yytext; }
{ID} { current->args += yytext;
Argument *a = new Argument;
a->name = yytext;
current->argList->append(a);
}
}
/*------------------------------------------------------------------------------------------------*/
<*>"\n" {
...
...
@@ -1111,7 +1135,10 @@ private {
/*---- error: EOF in wrong state --------------------------------------------------------------------*/
<*><<EOF>> {
if ( include_stack_ptr <= 0 ) {
if (parsingPrototype) {
yyterminate();
} else if ( include_stack_ptr <= 0 ) {
if (YY_START!=INITIAL && YY_START!=Start) {
DBG_CTX((stderr,"==== Error: EOF reached in wrong state (end missing)"));
scanner_abort();
...
...
@@ -2304,7 +2331,13 @@ void FortranLanguageScanner::resetCodeParserState()
void FortranLanguageScanner::parsePrototype(const char *text)
{
current->name = QCString(text).lower();
QCString buffer = QCString(text).lower();
pushBuffer(buffer);
parsingPrototype = TRUE;
BEGIN(Prototype);
fscanYYlex();
parsingPrototype = FALSE;
popBuffer();
}
static void scanner_abort()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment