Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --fdump-tree=FILE option #108

Draft
wants to merge 10 commits into
base: gcos4gnucobol-3.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cobc/ChangeLog.branch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be dropped

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just put the ChangeLog of the branch outside of the ChangeLog, because it creates a conflict everytime I rebased it. I will keep it that way until the work is finished.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

* cobc.c, dump_tree.c: new options to dump the AST in text format:
--dump-tree=<file>, and --dump-tree-flags=<flags>. Format is
either OCaml (for files with .ml extension) or JSON. If file
ends with '/', then it is expected to be a directory and the
file will be generated with the program id as name. Flags are
'+/-' for enable/disable, 'c' for cb_common, 'l' for locations,
't' for types, 'p' for pointers, 'i' for indentation, 'n' for
newlines, 'A' for all infos, 'O' for OCaml format, 'J' for
JSON format, 'm' for message. Env variables COB_DUMP_TREE and
COB_DUMP_TREE_FLAGS can also be used to set these flags.
6 changes: 3 additions & 3 deletions cobc/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#

# Makefile gnucobol/cobc
#
# Copyright (C) 2003-2012, 2014-2021 Free Software Foundation, Inc.
Expand All @@ -23,7 +23,7 @@ bin_PROGRAMS = cobc
cobc_SOURCES = cobc.c cobc.h ppparse.y pplex.c parser.y scanner.c config.c \
reserved.c error.c tree.c tree.h field.c typeck.c codegen.c help.c \
config.def flag.def warning.def codeoptim.def ppparse.def \
codeoptim.c replace.c dump_tree.c dump_tree_gen.c
codeoptim.c replace.c dump_tree.c

#cobc_SOURCES = cobc.c cobc.h ppparse.y pplex.l parser.y scanner.l config.c

Expand Down Expand Up @@ -73,4 +73,4 @@ dump_tree.$(OBJEXT): $(top_srcdir)/cobc/dump_tree_gen.c
.PHONY: update-dump-tree

update-dump-tree:
ctypes2json --generic -I $(top_srcdir)/cobc -I $(top_srcdir)/lib > $(top_srcdir)/cobc/dump_tree_gen.c
ctypes2json -I $(top_srcdir)/cobc -I $(top_srcdir)/lib > $(top_srcdir)/cobc/dump_tree_gen.c
Loading
Loading