codeParser.js 711 B

12345678910111213141516171819202122232425262728293031323334
  1. import * as Models from '../visualUI/ivprog_elements';
  2. function parseGlobal (global_obj) {
  3. var new_global = new Models.Variable(
  4. global_obj.type,
  5. global_obj.name,
  6. global_obj.value);
  7. new_global.is_constant = global_obj.is_const;
  8. new_global.columns = global_obj.columns;
  9. new_global.dimension = global_obj.dimension;
  10. new_global.rows = global_obj.rows;
  11. window.program_obj.addGlobal(new_global);
  12. }
  13. function parseFunction (function_obj) {
  14. }
  15. export function parserCodeVisual (code_obj = null) {
  16. console.log('chegou!', code_obj)
  17. window.conteudo = code_obj
  18. // Globals:
  19. code_obj.globals.forEach(parseGlobal);
  20. // Functions:
  21. code_obj.functions.forEach(parseFunction);
  22. }