Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.

scopeStack.h

Description du code

Fonctions de gestion d'une pile de portées Compilateur LSD010

Code source ou contenu du fichier

  1. /*
  2.  * scopeStack.h : Exposed items to manage a stack of scopes
  3.  * for a declaration symbol and his re-declarations
  4.  * Part of the compiler project for LSD10 language
  5.  * Gaudry Stéphane
  6.  * More information on http://www.gaudry.be/langages-lex-yacc-intro.html
  7.  * **********************************************************
  8.  */
  9. #ifndef SCOPE_STACK_H
  10. #define SCOPE_STACK_H
  11. #include "common.h"
  12.  
  13. /**
  14. * Stack of scopes for a declaration symbol and his re-declarations
  15. * @todo: This exposes the internal data representations, must be hidden
  16. */
  17. typedef struct ScopeStackStruct
  18. {
  19. /**
  20. * AST node of the variable or function declaration
  21. */
  22. struct astNode *declarationNode;
  23. VariableUsage usage;
  24. struct astNode *functionNode;
  25. struct ScopeStackStruct *parentPtr;
  26. }ScopeStack;
  27.  
  28. /**
  29. * Builds a scope stack instance
  30. */
  31. ScopeStack *createScopeStack();
  32. /**
  33. * Free resources of the scope stack
  34. */
  35. void finalizeScopeStack(ScopeStack **scopeStack);
  36. /**
  37. * Adds an inner scope into the stack (enter into a new subscope from the current scope)
  38. * @param scopeStack current scope where the new scope is defined
  39. * @param scopeId id of the subscope
  40. * @param declarationNode declaration of the symbol for this scope
  41. *
  42. * Pre-condition: scopeStack argument not null
  43. */
  44. void pushScopesStack(ScopeStack **scopeStack, int scopeId, AstNode *declarationNode);
  45. /**
  46. * Removes a scope from the stack (exit a scope and return to the parent scope)
  47. * @param scopeStack current scope to remove (this pointer will address the parent scope after)
  48. * @returns current declaration node from the AST
  49. * Pre-condition: scopeStack argument not null
  50. */
  51. AstNode *popScopeStack(ScopeStack **scopeStack);
  52. /**
  53. * Sets scopeDepth for a given ScopeStack item (Not for all of the stack)
  54. * @param scopeStack ScopeStack where to set the depth
  55. * @param scopeDepth depth value to set
  56. * Pre-condition: scopeStack argument not null
  57. */
  58. void setScopesStackDepth(ScopeStack *scopeStack, int scopeDepth);
  59. /**
  60. * Returns the depth of a scopeStack, or ERROR_INT on error
  61. * @param scopeStack ScopeStack where to find the depth
  62. */
  63. int getScopeDepth(ScopeStack *scopeStack);
  64.  
  65. #endif

Autres extraits de codes en c

  • DisquetteDispo Vérifier la disponibilité du lecteur de disquette
  • Suite de Fibonacci Exemple d'itération en C
  • Suite de Fibonacci Exemple de récursion en C
  • astDataRepresentation.h Représentation de données de l'arbre syntaxique abstrait Compilateur LSD010
  • ast.h Arbre syntaxique abstrait Compilateur LSD010
  • ast.c Arbre syntaxique abstrait Compilateur LSD010
  • symbolsTableDataRepresentation.h Représentation de données de la table des symboles Compilateur LSD010
  • symbolsTable.h Fonctions de gestion de la table des symboles Compilateur LSD010
  • symbolsTable.c Fonctions de gestion de la table des symboles Compilateur LSD010
  • hashCode.h Fonctions de hachage Compilateur LSD010
  • hashCode.c Fonctions de hachage Compilateur LSD010
  • scopeStack.h Fonctions de gestion d'une pile de portées Compilateur LSD010
  • scopeStack.c Fonctions de gestion d'une pile de portées Compilateur LSD010
  • scopeHelper.h Fonctions de gestion de la portée courante Compilateur LSD010
  • console.h Fonctions d'affichage Compilateur LSD010
  • console.c Fonctions d'affichage Compilateur LSD010
  • graphVizHelper.h Génération d'une image d'un arbre syntaxique abstrait.
    Classe d'intégration de l'outil GraphViz. Compilateur LSD010
  • graphVizHelper.c Génération d'une image d'un arbre syntaxique abstrait.
    Classe d'intégration de l'outil GraphViz. Compilateur LSD010
  • common.h Définition des constantes et variables communes Compilateur LSD010
  • pcode.c Génération de p-code Compilateur LSD010
  • pcode.h Génération de p-code Compilateur LSD010
  • Tous les extraits

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 05/10/2009, zuletzt geändert 28/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/sniplet-rf-lsd010/project/source/scopeStack.h.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.