Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.

ast.h

Description du code

Arbre syntaxique abstrait Compilateur LSD010

Code source ou contenu du fichier

  1. /*
  2.  * ast.h : generation of an Abstract Syntaxic Tree,
  3.  * and LSD10 constraints checks (data types, etc.).
  4.  * Part of the compiler project for LSD10 language
  5.  * Gaudry Stéphane
  6.  * More information on http://www.gaudry.be/langages-analyse-syntaxique-ast.html
  7.  */
  8. #ifndef AST_H
  9. #define AST_H
  10. #include "common.h"
  11. #include "const.h"
  12. #include "astDataRepresentation.h" //todo : don't include this to hide real data representation
  13.  
  14. /*
  15. * **********************************************************
  16. * AST creation and destruction functions
  17. * **********************************************************
  18. */
  19.  
  20. /**
  21. * Allocates memory space and creates an AST node information
  22. */
  23. AstNodeInfo* createASTNodeInfo(char *name, int type, int value);
  24.  
  25. /**
  26. * Allocates memory space and creates an AST node
  27. */
  28. AstNode* createASTNode(debugYacc yaccPsn, int type, AstNodeInfo *info, AstNode *right, AstNode *left);
  29.  
  30. /**
  31. * Creates a default initialized debug structure
  32. * Exposed Method
  33. */
  34. DebugInfo* createDebug();
  35.  
  36. /**
  37. * Cleans memory allocated for the AST
  38. */
  39. void finalizeAST();
  40.  
  41. /*
  42. * **********************************************************
  43. * AST functions
  44. * **********************************************************
  45. */
  46. /**
  47. * Sets a node type type
  48. */
  49. void setNodeType(AstNode *node, int type);
  50. /**
  51. * Sets a node subtype
  52. */
  53. void setNodeSubType(AstNode *node, int subtype);
  54. /**
  55. * Sets a definitive var type or function type to avoid check later
  56. * Pre-condition: node not null
  57. */
  58. void setComputedType(AstNode *node, int varType);
  59.  
  60. /**
  61. * Returns a human readable string from a given type constant value
  62. * Expected : one of the NODE_TYPE_xxx or LEXICAL_VAR_TYPE_xxx or Yacc(yytokentype) constants
  63. */
  64. char* typeToString(int type);
  65.  
  66. /**
  67. * Performs some verifications into the AST for types matching,
  68. * validity of main function, etc.
  69. */
  70. void checkAST();
  71.  
  72. /**
  73. * Checks if the first given node is before the second, based on the source code position
  74. * Returns one of the AST_CMP_BEFORE, AST_CMP_EQUALS, AST_CMP_AFTER constants, or other values on NULL arg
  75. * Pre-condition: node1 and node2 not modified
  76. */
  77. int isBefore(AstNode *node1, AstNode *node2);
  78.  
  79. /**
  80. * Returns the main function node
  81. * Pre-condition: a call to checkAST() must be done before, or returns NULL
  82. */
  83. AstNode* getMain();
  84.  
  85. #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

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 05/10/2009 gemaakt, de laatste keer de 28/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/sniplet-rf-lsd010/project/source/ast.h.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.