comment parser interfaced although not oworking
This commit is contained in:
parent
7d607f426b
commit
8db0ab3c51
3 changed files with 16 additions and 4 deletions
|
|
@ -29,6 +29,8 @@
|
|||
#include "expression.h"
|
||||
#include "context.h"
|
||||
#include "evalcontext.h"
|
||||
|
||||
extern AssignmentList * parser(const char *text);
|
||||
#include <iostream>
|
||||
#include <boost/assign/std/vector.hpp>
|
||||
using namespace boost::assign; // bring 'operator+=()' into scope
|
||||
|
|
@ -44,6 +46,12 @@ Annotation::~Annotation()
|
|||
|
||||
const Annotation * Annotation::create(const std::string name, const AssignmentList assignments)
|
||||
{
|
||||
AssignmentList *assignment;
|
||||
if (name == "DParameter") {
|
||||
assignment=parser("[12:34]");
|
||||
return create("Parameter",*assignment);
|
||||
}
|
||||
|
||||
AssignmentList args;
|
||||
if (name == "Description") {
|
||||
args += Assignment("text");
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
void yyerror(char *);
|
||||
int yylex(void);
|
||||
AssignmentList *argument;
|
||||
extern const char *parser_input_buffer;
|
||||
%}
|
||||
%union {
|
||||
char *text;
|
||||
|
|
@ -19,6 +20,7 @@
|
|||
|
||||
};
|
||||
|
||||
|
||||
%token<text> NUM
|
||||
%token<text> WORD
|
||||
%type <expr> expr
|
||||
|
|
@ -107,7 +109,9 @@ void yyerror(char *s) {
|
|||
cout<<s<<endl;
|
||||
}
|
||||
|
||||
int parse(void) {
|
||||
yyparse();;
|
||||
return 0;
|
||||
AssignmentList * parser(const char *text) {
|
||||
parser_input_buffer = text;
|
||||
yyparse();
|
||||
return argument;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ parameters:
|
|||
parameter:
|
||||
COMMENT arguments_call
|
||||
{
|
||||
$$ = Annotation::create("Parameter", *$2);
|
||||
$$ = Annotation::create("DParameter", *$2);
|
||||
}
|
||||
;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue