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
38059b8b
Commit
38059b8b
authored
May 22, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7 from ogbash/experimental/prototype
Fortran: parse prototype in out-of-place documentation
parents
9bfa0dd1
be4c107a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
2 deletions
+37
-2
fortranscanner.l
src/fortranscanner.l
+37
-2
No files found.
src/fortranscanner.l
View file @
38059b8b
...
@@ -187,6 +187,7 @@ static InterfaceType ifType = IF_NONE;
...
@@ -187,6 +187,7 @@ static InterfaceType ifType = IF_NONE;
static bool functionLine = FALSE;
static bool functionLine = FALSE;
static char stringStartSymbol; // single or double quote
static char stringStartSymbol; // single or double quote
static bool parsingPrototype = FALSE; // see parsePrototype()
//! Accumulated modifiers of current statement, eg variable declaration.
//! Accumulated modifiers of current statement, eg variable declaration.
static SymbolModifiers currentModifiers;
static SymbolModifiers currentModifiers;
...
@@ -265,6 +266,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
...
@@ -265,6 +266,7 @@ ATTR_STMT {ATTR_SPEC}|DIMENSION|{ACCESS_SPEC}
CONTAINS CONTAINS
CONTAINS CONTAINS
PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTAL)?
PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTAL)?
SCOPENAME ({ID}{BS}"::"{BS})*
%option noyywrap
%option noyywrap
%option stack
%option stack
...
@@ -307,6 +309,12 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA
...
@@ -307,6 +309,12 @@ PREFIX (RECURSIVE{BS_}|PURE{BS_}|ELEMENTAL{BS_}){0,2}(RECURSIVE|PURE|ELEMENTA
%x EndDoc
%x EndDoc
%x BlockData
%x BlockData
/** prototype parsing */
%x Prototype
%x PrototypeSubprog
%x PrototypeArgs
%%
%%
/*-----------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------*/
...
@@ -1099,6 +1107,24 @@ private {
...
@@ -1099,6 +1107,24 @@ private {
yy_pop_state();
yy_pop_state();
}
}
/*-----Prototype parsing -------------------------------------------------------------------------*/
<Prototype>{BS}{SUBPROG}{BS_} {
BEGIN(PrototypeSubprog);
}
<Prototype,PrototypeSubprog>{BS}{SCOPENAME}?{BS}{ID} {
current->name = QCString(yytext).lower();
current->name.stripWhiteSpace();
BEGIN(PrototypeArgs);
}
<PrototypeArgs>{
"("|")"|","|{BS_} { current->args += yytext; }
{ID} { current->args += yytext;
Argument *a = new Argument;
a->name = QCString(yytext).lower();
current->argList->append(a);
}
}
/*------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------*/
<*>"\n" {
<*>"\n" {
...
@@ -1111,7 +1137,10 @@ private {
...
@@ -1111,7 +1137,10 @@ private {
/*---- error: EOF in wrong state --------------------------------------------------------------------*/
/*---- error: EOF in wrong state --------------------------------------------------------------------*/
<*><<EOF>> {
<*><<EOF>> {
if ( include_stack_ptr <= 0 ) {
if (parsingPrototype) {
yyterminate();
} else if ( include_stack_ptr <= 0 ) {
if (YY_START!=INITIAL && YY_START!=Start) {
if (YY_START!=INITIAL && YY_START!=Start) {
DBG_CTX((stderr,"==== Error: EOF reached in wrong state (end missing)"));
DBG_CTX((stderr,"==== Error: EOF reached in wrong state (end missing)"));
scanner_abort();
scanner_abort();
...
@@ -2304,7 +2333,13 @@ void FortranLanguageScanner::resetCodeParserState()
...
@@ -2304,7 +2333,13 @@ void FortranLanguageScanner::resetCodeParserState()
void FortranLanguageScanner::parsePrototype(const char *text)
void FortranLanguageScanner::parsePrototype(const char *text)
{
{
current->name = QCString(text).lower();
QCString buffer = QCString(text);
pushBuffer(buffer);
parsingPrototype = TRUE;
BEGIN(Prototype);
fscanYYlex();
parsingPrototype = FALSE;
popBuffer();
}
}
static void scanner_abort()
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