-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] Add test dir for regression testing of generation of cxref db
- Loading branch information
Showing
170 changed files
with
38,258 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include ../Makefile.boilerplate | ||
|
||
COMMAND = ../../src/c-xref | ||
ARGUMENTS = -xrefactory-II -create -errors -xrefrc .c-xrefrc -p $(CURDIR) -o output.tmp src | ||
|
||
$(TEST): c_xrefrc_for_single_cxref_file | ||
rm CXrefs | ||
$(COMMAND) $(ARGUMENTS) | grep -v progress > output | ||
cat CXrefs >> output | ||
echo "<sync>" > expected | ||
cat expected.cxrefs >> expected | ||
$(VERIFY) | ||
|
||
c_xrefrc_for_single_cxref_file: .c-xrefrc | ||
ifeq ($(shell uname), Darwin) | ||
sed -i '' 's/refnum=10/refnum=1/' .c-xrefrc | ||
else | ||
sed -i 's/refnum=10/refnum=1/' .c-xrefrc | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef AST_INCLUDED | ||
#define AST_INCLUDED | ||
|
||
#include "symbol.h" | ||
#include "id.h" | ||
#include "proto.h" /* Because some AST nodes need types */ | ||
|
||
|
||
/* ************** parse tree with positions *********** */ | ||
|
||
// The following structures are used in the parsers, they always | ||
// contain fields for begin and end position of parse tree | ||
// node and additional 'data' for semantic actions. | ||
|
||
typedef struct { | ||
struct position begin, end; | ||
int data; | ||
} Ast_int; | ||
typedef struct { | ||
struct position begin, end; | ||
unsigned data; | ||
} Ast_unsigned; | ||
typedef struct { | ||
struct position begin, end; | ||
struct symbol *data; | ||
} Ast_symbol; | ||
typedef struct { | ||
struct position begin, end; | ||
struct symbolList *data; | ||
} Ast_symbolList; | ||
typedef struct { | ||
struct position begin, end; | ||
struct typeModifier *data; | ||
} Ast_typeModifiers; | ||
typedef struct { | ||
struct position begin, end; | ||
struct typeModifierList *data; | ||
} Ast_typeModifiersList; | ||
typedef struct { | ||
struct position begin, end; | ||
struct stackFrame *data; | ||
} Ast_frameAllocation; | ||
typedef struct { | ||
struct position begin, end; | ||
Id *data; | ||
} Ast_id; | ||
typedef struct { | ||
struct position begin, end; | ||
struct idList *data; | ||
} Ast_idList; | ||
typedef struct { | ||
struct position begin, end; | ||
struct expressionTokenType data; | ||
} Ast_expressionTokenType; | ||
typedef struct { | ||
struct position begin, end; | ||
struct nestedConstrTokenType data; | ||
} Ast_nestedConstrTokenType; | ||
typedef struct { | ||
struct position begin, end; | ||
struct intPair data; | ||
} Ast_intPair; | ||
typedef struct { | ||
struct position begin, end; | ||
struct whileExtractData *data; | ||
} Ast_whileExtractData; | ||
typedef struct { | ||
struct position begin, end; | ||
struct position data; | ||
} Ast_position; | ||
typedef struct { | ||
struct position begin, end; | ||
struct unsignedPositionPair data; | ||
} Ast_unsignedPositionPair; | ||
typedef struct { | ||
struct position begin, end; | ||
struct symbolPositionPair data; | ||
} Ast_symbolPositionPair; | ||
typedef struct { | ||
struct position begin, end; | ||
struct symbolPositionListPair data; | ||
} Ast_symbolPositionListPair; | ||
typedef struct { | ||
struct position begin, end; | ||
struct positionList *data; | ||
} Ast_positionList; | ||
typedef struct { | ||
struct position begin, end; | ||
struct typeModifiersListPositionListPair data; | ||
} Ast_typeModifiersListPositionListPair; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
External declarations from c_parser-"module". | ||
*/ | ||
|
||
#ifndef C_PARSER_H_INCLUDED | ||
#define C_PARSER_H_INCLUDED | ||
|
||
#include "proto.h" | ||
|
||
extern int c_yyparse(); | ||
extern void makeCCompletions(char *s, int len, Position *pos); | ||
|
||
#endif |
Oops, something went wrong.