symbolsTable.c

Description du code

symbolsTable.c est un fichier du projet Compilateur LSD010.
Ce fichier est situé dans /var/www/bin/sniplets/lsd010/.

Projet Compilateur LSD010 :

Compilateur LSD010 développé dans le cadre du cours de syntaxe et sémantiqueref 1

Code source ou contenu du fichier

  1. /*
  2.  * symbolsTable.c : Implementation to manage the symbols table
  3.  * Part of the compiler project for LSD10 language
  4.  * Gaudry Stéphane
  5.  * More information on http://www.gaudry.be/langages-table-des-symboles.html
  6.  * **********************************************************
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #if(VERBOSE_LEVEL<=DEB_E)
  13. #include <errno.h>
  14. #endif
  15. #include "symbolsTableDataRepresentation.h"
  16. #include "scopeStack.h"
  17. #include "scopeHelper.h"
  18. #include "common.h"
  19. #include "hashCode.h"
  20.  
  21. /*
  22.  * **********************************************************
  23.  * Internal business implementations
  24.  * **********************************************************
  25.  */
  26.  
  27. int symbolsTableAvailable=0;
  28. /**
  29.  * Memory location of the last declaration
  30.  */
  31. int memoryUpperBound=INITIAL_INT;
  32.  
  33. /**
  34.  * Creates a new SymTableEntry instance.
  35.  */
  36. SymTableEntry* createSymTableEntry(AstNode *declarationNode)
  37. {
  38. SymTableEntry *entry=(SymTableEntry*)malloc(sizeof(SymTableEntry));
  39. if(!(entry))
  40. {
  41. if(VERBOSE_LEVEL<=DEB_E)
  42. {
  43. printMsg(DEB_E,"Allocation Error(SymTableEntry)", __FILE__, __LINE__);
  44. printMsg(DEB_E, (char *)strerror(errno), __FILE__, __LINE__);
  45. }
  46. //Failure of the compiler behavior, independent of the parsed code
  47. exit(EXIT_FAILURE);
  48. }
  49. entry->next = NULL;
  50.  
  51. ScopeStack *scopeStack = createScopeStack();
  52. scopeStack->declarationNode = declarationNode;
  53. scopeStack->parentPtr = NULL;
  54. declarationNode->info->memoryLocation=memoryUpperBound;
  55. scopeStack->functionNode = (AstNode *)scopeHelperGetCurrentFunction();
  56. if(declarationNode==getMain())
  57. {
  58. scopeStack->usage=VAR_USAGE_ALWAYS;
  59. }
  60. entry->scopeStack = scopeStack;
  61. #if(VERBOSE_LEVEL<=DEB_SYM)
  62. "\n;\tCreation of an entry for %s on scope %d (compiler %s, %d)....main=%s\n",
  63. declarationNode->info->name,
  64. getScopeDepth(scopeStack),
  65. __FILE__,
  66. __LINE__,
  67. getMain()==NULL?"null":"ok"
  68. );
  69. #endif
  70. return entry;
  71. }
  72. void finalizeSymTableEntry(SymTableEntry *entry)
  73. {
  74. if(entry!=NULL)
  75. {
  76. finalizeSymTableEntry(entry->next);
  77. free(entry);
  78. }
  79. }
  80. /**
  81.  * Search only on a given scope stack for a declaration
  82.  * Pre-condition: the scope stack matches the identifier
  83.  * @param astNode, pointer to the node for witch we search the declaration
  84.  * @param scopeId
  85.  * @param scopeStack, pointer to the stack where to search
  86.  */
  87. ScopeStack* searchDeclarationOnStack(AstNode *astNode, int scopeId, ScopeStack *scopeStack)
  88. {
  89. if(scopeStack==NULL)
  90. {
  91. return NULL;
  92. }
  93. int foundScopeId=getScopeDepth(scopeStack);
  94. #if(VERBOSE_LEVEL<=DEB_SYM)
  95. "\n;------Search for %s [%p, scope %d] on scope %d (compiler %s,%d)\n",
  96. astNode->info->name,
  97. astNode,
  98. foundScopeId,
  99. scopeId,
  100. __FILE__,
  101. __LINE__
  102. );
  103. #endif
  104. // there is a scopeStackPtr for this identifier
  105. if(foundScopeId!=ERROR_INT && foundScopeId<=scopeId)
  106. {
  107. return scopeStack;
  108. }
  109. #if(VERBOSE_LEVEL<=DEB_SYM)
  110. "\n; Nothing found for %s (%p) on scope %d (compiler %s,%d)\n",
  111. astNode->info->name,
  112. astNode,
  113. scopeId,
  114. __FILE__,
  115. __LINE__
  116. );
  117. #endif
  118. // search into the wrapper scope
  119. ScopeStack *parentScope = scopeStack->parentPtr;
  120. if(parentScope!=NULL)
  121. {
  122. #if(VERBOSE_LEVEL<=DEB_SYM)
  123. "\n;------Try to search on parent scope [%p] for %s [%p] (compiler %s,%d)\n",
  124. parentScope,
  125. astNode->info->name,
  126. astNode,
  127. __FILE__,
  128. __LINE__
  129. );
  130. #endif
  131. return searchDeclarationOnStack(astNode, scopeId, parentScope);
  132. }
  133. else
  134. {
  135. #if(VERBOSE_LEVEL<=DEB_SYM)
  136. "\n;------Scope %d, No parent scope where to search for %s (compiler %s,%d)\n",
  137. foundScopeId,
  138. astNode->info->name,
  139. __FILE__,
  140. __LINE__
  141. );
  142. #endif
  143. }
  144. return NULL;
  145. }
  146. /**
  147.  * Search on all of the linked list of given scope stack for a declaration
  148.  * @param currentNode, pointer to the node for witch we search the declaration
  149.  * @param scopeId, scope where to search
  150.  * @param scopeStack, pointer to the stack where to start search
  151.  */
  152. ScopeStack* searchDeclaration(AstNode *currentNode, int scopeId, SymTableEntry *entry)
  153. {
  154. if(entry==NULL || entry->scopeStack==NULL)
  155. {
  156. return NULL;
  157. }
  158. // if(currentNode==NULL)
  159. // {
  160. // return NULL;
  161. // }
  162. // if(currentNode->info==NULL)
  163. // {
  164. // return NULL;
  165. // }
  166. // test name to detect hashcode collisions
  167. if(strcmp(getEntryName(entry), currentNode->info->name)!=0)
  168. {
  169. // printf(
  170. // "\n; collision: %s searched, %s found, %s next\n",
  171. // currentNode->info->name,
  172. // entry->scopeStack->declarationNode->info->name,
  173. // entry->next==NULL?"null":entry->next->scopeStack->declarationNode->info->name
  174. // );
  175. // if there is collision of hashcodes, search into the next identifier stack
  176. return searchDeclaration(currentNode, scopeId, entry->next) ;
  177. }
  178. // printf(
  179. // "\nOK : %s searched, %s found\n",
  180. // currentNode->info->name,
  181. // entry->scopeStack->declarationNode->info->name
  182. // );
  183. // the scope stack matches the identifier
  184. return searchDeclarationOnStack(currentNode, scopeId, entry->scopeStack);
  185. }
  186. /**
  187.  * Search into the symbols table for a declaration of a given AST node for the current scope.
  188.  * If no backward declaration exists, the program exits with an error message
  189.  * pre-condition: astNode not NULL
  190.  */
  191. ScopeStack* getScopeDeclaration(AstNode* astNode)
  192. {
  193. int hash = getASTHashCode(astNode);
  194.  
  195. ScopeStack* foundStack = NULL;
  196. #if(VERBOSE_LEVEL<=DEB_SYM)
  197. "\n;------Search for %s; current scope=%d, Table[%d] %s (compiler %s,%d)",
  198. astNode->info->name,
  199. astNode->info->scopeId,
  200. hash,
  201. declarations[hash]==NULL?"empty":"not empty",
  202. __FILE__,
  203. __LINE__
  204. );
  205. #endif
  206. if(declarations[hash]!=NULL)
  207. {
  208. foundStack = searchDeclaration(astNode, scopeHelperGetCurrentScope(), declarations[hash]);
  209. // printf(
  210. // "\n;\tnode=%s; founstack=%s\n",
  211. // astNode->info->name,
  212. // foundStack==NULL?"null":foundStack->declarationNode->info->name
  213. // );
  214. if(foundStack!=NULL && isBefore(astNode, foundStack->declarationNode)==AST_CMP_BEFORE)
  215. {
  216. #if(VERBOSE_LEVEL<=DEB_E)
  217. ";\n;\tForward declaration detected for %s line %d col %d, declaration line %d col%d",
  218. astNode->info->name,
  219. astNode->debug->line,
  220. astNode->debug->linePsn,
  221. foundStack->declarationNode->debug->line,
  222. foundStack->declarationNode->debug->linePsn
  223. );
  224. #endif
  225. foundStack=NULL;
  226. }
  227. }
  228. //else printf("\nentry null (%s,%d)",__FILE__, __LINE__);
  229. if(foundStack==NULL)
  230. {
  231. char errorStr[1024];//todo: minimize length
  232. errorStr,
  233. "No previous declaration found for %s line %d col %d (compiler %s,%d)",
  234. astNode->info->name,
  235. astNode->debug->line,
  236. astNode->debug->linePsn,
  237. __FILE__,
  238. __LINE__
  239. );
  240. onError(errorStr, __FILE__, __LINE__, astNode);
  241. }
  242. #if(VERBOSE_LEVEL<=DEB_SYM)
  243. printf("\n;------Found %s (%p)",astNode->info->name, astNode);
  244. #endif
  245. return foundStack;
  246. }
  247. /**
  248.  * Adds a declaration into the symbols table
  249.  * @param entry pointer to an existing item of linked list (to solve hash collisions)
  250.  * @param declarationNode declaration to add into the symbols table
  251.  * @param hash index of the item on the symbols table
  252.  * pre-condition: entry not null
  253.  */
  254. void addSafeDeclaration(SymTableEntry *entry, AstNode* declarationNode, int hash)
  255. {
  256. if(strcmp( getEntryName(entry), declarationNode->info->name )!=0)
  257. {
  258. // hash collision detected;
  259. #if(VERBOSE_LEVEL<=DEB_SYM)
  260. "\n;------Collision detected for %s hash=%d [%s found on %p] (compiler %s,%d)",
  261. declarationNode->info->name,
  262. hash,
  263. getEntryName(entry),
  264. entry,
  265. __FILE__,
  266. __LINE__
  267. );
  268. #endif
  269. SymTableEntry *nextEntry = entry->next;
  270. if(nextEntry==NULL)
  271. {
  272. SymTableEntry *tempEntry = createSymTableEntry(declarationNode);
  273. tempEntry->next=entry;
  274. // we add the new entry as first item of the linked list(proximity possible usage)
  275. declarations[hash]=tempEntry;
  276. }
  277. else
  278. {
  279. addSafeDeclaration(nextEntry, declarationNode, hash);
  280. }
  281. }
  282. else
  283. {
  284. #if(VERBOSE_LEVEL<=DEB_SYM)
  285. "\n;------A scope exists for %s [%s] (compiler %s,%d)",
  286. declarationNode->info->name,
  287. getEntryName(entry),
  288. __FILE__,
  289. __LINE__
  290. );
  291. #endif
  292. int curScope = scopeHelperGetCurrentScope();
  293. int foundScope = getScopeDepth(entry->scopeStack);
  294. if(foundScope==curScope)
  295. {
  296. AstNode* foundNode = entry->scopeStack->declarationNode;
  297. char errorStr[1024];//todo: minimize length
  298. errorStr,
  299. "A previous declaration for %s (scope %d line %d col %d) has been detected (scope %d line %d col %d) by compiler %s,%d",
  300. declarationNode->info->name,
  301. curScope,
  302. declarationNode->debug->line,
  303. declarationNode->debug->linePsn,
  304. foundScope,
  305. foundNode->debug->line,
  306. foundNode->debug->linePsn,
  307. __FILE__,
  308. __LINE__
  309. );
  310. onError(errorStr, __FILE__, __LINE__, declarationNode);
  311. }
  312. pushScopesStack(&(entry->scopeStack), scopeHelperGetCurrentScope(), declarationNode);
  313. entry->scopeStack->declarationNode->info->memoryLocation=memoryUpperBound;
  314. }
  315. }
  316. /**
  317.  * Parses nodes from variable usage node to root to detect if we are on a conditional bloc
  318.  */
  319. void checkUsage(ScopeStack* scopeStack, AstNode *node)
  320. {
  321. if(scopeStack==NULL)
  322. {
  323. scopeStack = getScopeDeclaration(node);
  324. }
  325. if(scopeStack!=NULL && scopeStack->usage!=VAR_USAGE_ALWAYS)
  326. {
  327. while(node->parent!=NULL)
  328. {
  329. // printf(
  330. // "\n; Check usage for %s line %d col %d, parent=%s (compiler(%s, %d)",
  331. // node->info->name,
  332. // node->debug->line,
  333. // node->debug->linePsn,
  334. // node->parent==NULL?"NULL":node->parent->info->name,
  335. // __FILE__,
  336. // __LINE__
  337. // );
  338. switch(node->parent->subtype)
  339. {
  340. case LEXICAL_IF_STMT:
  341. case AST_IF_ELSE_STMT:
  342. scopeStack->usage = VAR_USAGE_SOMETIMES;
  343. return;
  344. }
  345. node=node->parent;
  346. }
  347. scopeStack->usage=VAR_USAGE_ALWAYS;
  348. }
  349. }
  350. /*
  351.  * **********************************************************
  352.  * Implementation of the header exposed items
  353.  * See symbolsTable.h for these functions comments
  354.  * **********************************************************
  355.  */
  356.  
  357. int setUsage(AstNode *currentVarNode, VariableUsage usage)
  358. {
  359. switch(currentVarNode->type)
  360. {
  361. case NODE_TYPE_ID:
  362. case NODE_TYPE_FUNCTION_CALL:
  363. break;
  364. default:return EXIT_FAILURE;
  365. }
  366. ScopeStack* foundStack = getScopeDeclaration(currentVarNode);
  367. if(foundStack==NULL)
  368. {
  369. return EXIT_FAILURE;
  370. }
  371. foundStack->usage = usage;
  372. }
  373.  
  374. char *getEntryName(SymTableEntry *entry)
  375. {
  376. if(entry==NULL)return "NULL entry";
  377. // if(entry->scopeStack==NULL)return "NULL entry stack";
  378. // if(entry->scopeStack->declarationNode==NULL)return "NULL entry declaration node";
  379. // if(entry->scopeStack->declarationNode->info==NULL)return "NULL entry declaration node info";
  380. return entry->scopeStack->declarationNode->info->name;
  381. }
  382.  
  383. int isSymbolsTableAvailable()
  384. {
  385. return symbolsTableAvailable;
  386. }
  387.  
  388. void initializeSymbolsTable()
  389. {
  390. setHashUpperBoundary(TABLES_SIZE);
  391. initializeScopeHelper();
  392. //declare i before ‘for’ statement because ‘for’ loop initial declarations are only allowed in C99 mode
  393. int i;
  394. for(i=0;i<TABLES_SIZE;i++)
  395. {
  396. declarations[i]=NULL;//createSymTableEntry(NULL);
  397. }
  398. symbolsTableAvailable=1;
  399. }
  400. void finalizeSymbolsTable()
  401. {
  402. //printScopeUsage();
  403. int i;
  404. for(i=0;i<TABLES_SIZE;i++)
  405. {
  406. finalizeSymTableEntry(declarations[i]);
  407. }
  408. symbolsTableAvailable=0;
  409. finalizeScopeHelper();
  410. }
  411. void enterScope()
  412. {
  413. scopeHelperEnterScope();
  414. }
  415. void exitScope()
  416. {
  417. scopeHelperExitScope();
  418. }
  419. int enterFunctionScope(AstNode* functionNode)
  420. {
  421. scopeHelperEnterScope();
  422. scopeHelperSetCurrentFunction(functionNode);
  423. }
  424. void addDeclaration(AstNode* declarationNode)
  425. {
  426. switch(declarationNode->type)
  427. {
  428. case NODE_TYPE_VAR_DECL:
  429. ++memoryUpperBound;
  430. case NODE_TYPE_PARAM_DECL:
  431. case NODE_TYPE_FUNCTION:
  432. {
  433. int hash = getASTHashCode(declarationNode);
  434. if(declarations[hash]==NULL)
  435. {
  436. #if(VERBOSE_LEVEL<=DEB_SYM)
  437. printf(";\n; Adding %s declaration into symbols table[new entry], scope=%d (compiler %s, line %d)",
  438. declarationNode->info->name,
  439. scopeHelperGetCurrentScope(),
  440. __FILE__,
  441. __LINE__
  442. );
  443. #endif
  444. declarations[hash]=createSymTableEntry(declarationNode);
  445. }
  446. else
  447. {
  448. #if(VERBOSE_LEVEL<=DEB_SYM)
  449. printf(";\n; Adding %s declaration into symbols table[existing entry], scope=%d (compiler %s, line %d)",
  450. declarationNode->info->name,
  451. scopeHelperGetCurrentScope(),
  452. __FILE__,
  453. __LINE__
  454. );
  455. #endif
  456. addSafeDeclaration(declarations[hash], declarationNode, hash);
  457. }
  458. #if(VERBOSE_LEVEL<=DEB_SYM)
  459. printSymbolsTableDebug(__FILE__, __LINE__);
  460. #endif
  461. }
  462. break;
  463. }
  464. // A declaration node is his own declaration
  465. declarationNode->info->declarationNode=declarationNode;
  466. }
  467.  
  468. AstNode* getDeclaration(AstNode *node)
  469. {
  470. if(node==NULL)
  471. {
  472. #if(VERBOSE_LEVEL<=DEB_E)
  473. {
  474. printMsg(DEB_E,"Illegal argument (NULL)", __FILE__, __LINE__);
  475. }
  476. #endif
  477. //Failure of the compiler behavior, independent of the parsed code
  478. exit(EXIT_FAILURE);
  479. }
  480. #if(VERBOSE_LEVEL<=DEB_SYM)
  481. printf(";\n; Get %s declaration from symbols table[bypass=%s] (compiler %s, line %d)",
  482. node->info->name,
  483. node->info->declarationNode==NULL?"no":"yes",
  484. __FILE__,
  485. __LINE__
  486. );
  487. #endif
  488. if(node->info->declarationNode!=NULL)
  489. {
  490. return node->info->declarationNode;
  491. }
  492. //node->info->scopeDepth=scopeHelperGetCurrentDepth();
  493. ScopeStack* foundStack = NULL;
  494. switch(node->type)
  495. {
  496. case NODE_TYPE_VAR_DECL:
  497. return node;
  498. case NODE_TYPE_FUNCTION:
  499. case NODE_TYPE_PARAM:
  500. #if(VAR_USAGE_REPORT_REQUESTED)
  501. checkUsage(foundStack, node);
  502. #endif
  503. return node;
  504. case NODE_TYPE_ID:
  505. case NODE_TYPE_FUNCTION_CALL:
  506. // if(node->info->declarationNode==NULL)
  507. // {
  508. #if(VERBOSE_LEVEL<=DEB_SYM)
  509. ";\n; Declaration not yet found for %s line %d col %d, must search into table (compiler %s, line %d)",
  510. node->info->name,
  511. node->debug->line,
  512. node->debug->linePsn,
  513. __FILE__,
  514. __LINE__
  515. );
  516. #endif
  517. foundStack = getScopeDeclaration(node);
  518. node->info->declarationNode = foundStack==NULL?NULL:foundStack->declarationNode;
  519. // }
  520. #if(VAR_USAGE_REPORT_REQUESTED)
  521. checkUsage(foundStack, node);
  522. #endif
  523. return node->info->declarationNode;
  524. }
  525. #if(VERBOSE_LEVEL<=DEB_E)
  526. {
  527. ";\n; Error : Illegal argument (%s is not an id or a function call) On %s, Line%d",
  528. node->info->name,
  529. __FILE__,
  530. __LINE__
  531. );
  532. }
  533. #endif
  534. //Failure of the compiler behavior, independent of the parsed code
  535. exit(EXIT_FAILURE);
  536. }
  537. int getDeclarationsMemoryUpperBound()
  538. {
  539. return memoryUpperBound;
  540. }
  541. int getDeclarationMemoryLocation(AstNode *node)
  542. {
  543. AstNode *declarationNode = getDeclaration(node);
  544. return declarationNode==NULL?INITIAL_INT:declarationNode->info->memoryLocation;
  545. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/lsd010/project/source/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1732332157 23/11/2024 04:22:37
Fichiers contenus dans /var/www/bin/sniplets/lsd010/project/source/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .o|.ographVizHelper.o4.72 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .c|.cast.c27.73 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hconst.h4.01 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .c|.cy.tab.c84.53 Ko31/10/2018 18:32:39-refusé-
Afficher le fichier .y|.ylsd10.y22.88 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .o|.olex.yy.o18.88 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .c|.cscopeStack.c3.69 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .h|.hgraphVizHelper.h573 octets31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hsymbolsTableDataRepresentation.h1.31 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .o|.osymbolsTable.o5.2 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .h|.hcommon.h1.08 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .c|.cscopeHelper.c4.09 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .o|.ohashCode.o1.45 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hconsole.h2.21 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .o|.oconsole.o12.23 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .|lsd10lsd1075.26 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .h|.hhashCode.h1020 octets31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hsymbolsTable.h2.65 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .h|.hpcode.h417 octets31/10/2018 18:32:38-refusé-
Afficher le fichier .o|.oast.o11.45 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hscopeStack.h2.2 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .c|.cgraphVizHelper.c6.11 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .l|.llsd10.l6.46 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .h|.hy.tab.h4.69 Ko31/10/2018 18:32:39-refusé-
Afficher le fichier .output|.outputy.output81.69 Ko31/10/2018 18:32:39-refusé-
Afficher le fichier .o|.oy.tab.o24.45 Ko31/10/2018 18:32:39-refusé-
Afficher le fichier .c|.clex.yy.c57.93 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hast.h2.39 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .o|.oscopeStack.o1.34 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .o|.oscopeHelper.o2.59 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .h|.hastDataRepresentation.h1.87 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .c|.csymbolsTable.c14.91 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .c|.cpcode.c23.45 Ko31/10/2018 18:32:38-refusé-
Afficher le fichier .c|.chashCode.c3.94 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .c|.cconsole.c18.01 Ko31/10/2018 18:32:37-refusé-
Afficher le fichier .h|.hscopeHelper.h719 octets31/10/2018 18:32:38-refusé-

Warning

Ce code présente une manière possible d'implémenter un compilateur, et certains choix peuvent être discutés.
Cependant, il peut donner des pistes pour démarrer, ou approcher certains concepts, et je tenterais par la suite de mettre à jour le code.

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

English translation

You have asked to visit this site in English. For now, only the interface is translated, but not all the content yet.

If you want to help me in translations, your contribution is welcome. All you need to do is register on the site, and send me a message asking me to add you to the group of translators, which will give you the opportunity to translate the pages you want. A link at the bottom of each translated page indicates that you are the translator, and has a link to your profile.

Thank you in advance.

Document created the 07/03/2010, last modified the 28/10/2018
Source of the printed document:https://www.gaudry.be/en/langages-lsd10-source-rf-project/source/symbolsTable.c.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

Notes
  1. a,b LSD010 : Langage Simple et Didactique Il existe une un certain nombre d'interprétations de l'acronyme LSD (Langage Symbolique Didactique, Langage Sans Difficulté, Langage Simple et Didactique). LSD010 est la version 2010 de la suite LSD80, LSD_02, LSD03, LSD04, LSD05, LSD06, LSD07, LSD08, et LSD09.

Contents Haut

References

  1. book Language of the document:fr IHDCB332 - Théorie des langages : Syntaxe et sémantique : PY Schobbens, Syntaxe et sémantique (January 2010)

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut