From 635edafd9c45dade5573594dd26582dd21152adb Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Tue, 29 Apr 2014 16:16:44 +0200 Subject: [PATCH 01/11] Removed demo file from source folder. --- src/demo.erl | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 src/demo.erl diff --git a/src/demo.erl b/src/demo.erl deleted file mode 100755 index 841ab61..0000000 --- a/src/demo.erl +++ /dev/null @@ -1,49 +0,0 @@ --module(demo). - --compile(export_all). - -gen_hrl()-> - write_hrl:write_hrl_file( - "../tests/vodkatv/vodkatv.xsd", - "vodkatv.hrl"). - -gen_eqc_statem()-> - write_eqc_statem:write_eqc_statem( - "../tests/vodkatv/vodkatv.wsdl", - "../tests/vodkatv/vodkatv.xsd", - none, - "vodkatv_sut", - tuple, - "vodkatv_eqc.erl"). - -gen_sut_api() -> - write_sut_api:write_sut_api( - none, - "../tests/vodkatv/vodkatv.wsdl", - "../tests/vodkatv/vodkatv.xsd", - "http://localhost:8082/vodkatv/", - "vodkatv_sut.erl"). - - -gen_diff() -> - ws_diff:gen_diff("../tests/vodkatv-wsdl-evolution/2014-01-29", - "../tests/vodkatv-wsdl-evolution/2014-02-17"). - - -gen_refac_script() -> - gen_refac_script:gen_refac_script( - {"../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd"}, - {"../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.xsd"}, - "refac_script.erl"). - - -gen_eqc_statem_140129()-> - write_eqc_statem:write_eqc_statem( - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd", - none, - "vodkatv_sut", - non_tuple, - "vodkatv_eqc_140129.erl"). From b30220d41b5092de8bc2e42ea8799fd1991d301f Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:53:17 +0200 Subject: [PATCH 02/11] Enforced use of erlsom in deps. --- Makefile | 2 +- include/erlsom.hrl | 27 ----------- include/erlsom_compile.hrl | 91 -------------------------------------- include/erlsom_parse.hrl | 72 ------------------------------ include/erlsom_sax.hrl | 90 ------------------------------------- rebar.config | 2 + src/gen_refac_script.erl | 6 +-- src/gen_xsd_model.erl | 6 +-- src/write_data_gen.erl | 6 +-- src/write_eqc_statem.erl | 7 +-- src/write_hrl.erl | 4 +- src/write_sut_api.erl | 6 +-- src/ws_diff.erl | 6 +-- src/ws_lib.erl | 4 +- 14 files changed, 26 insertions(+), 303 deletions(-) delete mode 100644 include/erlsom.hrl delete mode 100644 include/erlsom_compile.hrl delete mode 100644 include/erlsom_parse.hrl delete mode 100644 include/erlsom_sax.hrl diff --git a/Makefile b/Makefile index 62d8bdb..5315a5b 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) skip_deps=true compile + $(REBAR) -v skip_deps=true compile doc: $(REBAR) skip_deps=true doc diff --git a/include/erlsom.hrl b/include/erlsom.hrl deleted file mode 100644 index e3b520f..0000000 --- a/include/erlsom.hrl +++ /dev/null @@ -1,27 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% Header file for erlsom -%%% ==================================================================== - -%% prefix=the prefix that will be used in the result --record(ns, {uri, prefix}). --record(qname, {uri, localPart, prefix, mappedPrefix}). diff --git a/include/erlsom_compile.hrl b/include/erlsom_compile.hrl deleted file mode 100644 index 18c13ea..0000000 --- a/include/erlsom_compile.hrl +++ /dev/null @@ -1,91 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% Header file for erlsom_compile -%%% ==================================================================== - - -%% records for the structures as found in the XSD --record(schemaType, - {elInfo, targetNamespace, elementFormDefault, attributeFormDefault, blockDefault, finalDefault, - version, id, imports, elements}). --record(importType, {elInfo, id, namespace, schemaLocation, annotation}). --record(includeType, {elInfo, id, schemaLocation, annotation}). --record(redefineType, {elInfo, id, schemaLocation, elements}). --record(globalElementType, {elInfo, name, type, default, fixed, id, abstract, substitutionGroup, final, nillable, - annotation, simpleOrComplex, unique}). --record(localElementType, {elInfo, name, type, default, fixed, form, ref, minOccurs, maxOccurs, nillable, annotation, - simpleOrComplex, unique}). --record(globalComplexTypeType, {elInfo, name, final, abstract, block, mixed, id, annotation, model, attributes, anyAttribute}). --record(localComplexTypeType, {elInfo, mixed, annotation, model, attributes, anyAttribute}). --record(globalSimpleTypeType, {elInfo, name, id, annotation, model}). --record(localSimpleTypeType, {elInfo, annotation, model}). --record(simpleContentType, {elInfo, annotation, model, id}). --record(groupDefType, {elInfo, name, annotation, model}). --record(groupRefType, {elInfo, ref, minOccurs, maxOccurs}). --record(annotationType, {elInfo, annotation}). --record(globalAttributeType, {elInfo, name, type, use, fixed, default, id, model}). --record(localAttributeType, {elInfo, name, type, use, ref, fixed, form, default, model}). --record(choiceType, {elInfo, id, minOccurs, maxOccurs, annotation, alternatives}). --record(sequenceType, {elInfo, annotation, elements, minOccurs, maxOccurs}). --record(allType, {elInfo, annotation, elements, minOccurs, maxOccurs}). --record(attributeGroupDefType, {elInfo, id, name, annotation, attributes, anyAttribute}). --record(attributeGroupRefType, {elInfo, ref, id}). --record(anyType, {elInfo, any, minOccurs, maxOccurs, namespace, processContents}). --record(anyAttributeType, {elInfo, id, namespace, processContents, annotation}). --record(extensionType, {elInfo, base, annotation, attributes, anyAttribute}). --record(extensionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}). --record(restrictionType, {elInfo, annotation, any, attributes, anyAttribute, base}). --record(restrictionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}). --record(complexContentType, {elInfo, annotation, model, mixed}). - -%% This is added to the XSD to allow generation of an XML document --record(namespaceType, {prefix, 'URI'}). - -%% the rest is for internal use in the translation of the XSD to the -%% format used by the parser -%% path is used to give local elements a unique name (the 'path' to the element) --record(schemaInfo, {targetNamespace, elementFormDefault, namespacePrefix, namespaces, path=[], attGrps, atts, th}). - -%% typeInfo - the intermediate format. -%% global (true or false): we need to find out in the -%% end whether this type should be available as 'top level' element in the -%% xml document. --record(typeInfo, {typeName, - global, - typeType, - typeRef, - elements, - attributes = [], - anyAttr, - seqOrAll, - extends, - restricts, - mixed, - base, - substitutionGroup, - min = 1, - max = 1}). - --record(elementInfo, {alternatives, min = 1, max = 1, nillable}). --record(alternative, {tag, type, real, min = 1, max = 1, anyInfo}). --record(attrib, {name, optional, type, ref}). --record(attGrp, {name, atts, anyAttr}). diff --git a/include/erlsom_parse.hrl b/include/erlsom_parse.hrl deleted file mode 100644 index f34fff8..0000000 --- a/include/erlsom_parse.hrl +++ /dev/null @@ -1,72 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% header file for erslom_parse -%%% ==================================================================== - -%% header file for erlsom_parse. Contains the record definitions. - -%% the records that form the model - see erlsom_parse.erl for a -%% description. - --record(model, {tps, nss, - tns, %% target namespace (the URI, a string) - th %% type hierarchy, see 'tree'-functions in erlsom_lib - }). --record(type, {nm, tp = sequence, els, atts = [], anyAttr, nillable, nr, - mn = 1, mx = 1, mxd = false, %% mn & mx are only used by erlsom_compile - typeName}). - %% typeName is the 'real' name, to be used in xsi:type attributes - %% for derived types. The 'nm' field is actually a key, which may - %% include an additional prefix to differntiate between elements, types - %% and groups. --record(el, {alts, mn = 1, mx = 1, nillable, nr}). --record(alt, {tag, tp, nxt = [], mn = 1, mx = 1, rl = true, anyInfo}). --record(att, {nm, nr, opt, tp}). -%% -record(ns, {uri, pf}). --record(elInfo, {anyAttr}). --record(anyAttr, {prCont, ns, tns}). %% for anyAttributes --record(anyInfo, {prCont, ns, tns}). %% for any elements - --record(state, {currentState, resultSoFar, model, namespaces, - allNamespaces, continuationState}). - --record(cs, {re, %% remaining elements - sf, %% nr of elements of the current type received so far - er, %% element record: the result (so far) for this type - rl, %% 'real element': do we expect an end-tag? - mxd}). %% is this a mixed type? - --record(all, {re, %% remaining elements - nr, %% the sequence number of the current element - er}). %% element record: the result (so far) for this type - -%% altState is used for parsing alternatives within -%% a choice that can occur more than once --record(altState, {name, %% the tag we are processing - type, %% the type of this element - real, %% is this a 'real' element or a group ref - receivedSoFar, %% number of elements received - acc, %% values of elements already processed - min, %% minOccurs - max}). %% maxOccurs - --record(anyState, {anyInfo}). diff --git a/include/erlsom_sax.hrl b/include/erlsom_sax.hrl deleted file mode 100644 index 4d6ad06..0000000 --- a/include/erlsom_sax.hrl +++ /dev/null @@ -1,90 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% data structures produced by erlsom_sax -%%% ==================================================================== - -%% data structures produced by sax.erl. - --record(attribute, {localName, prefix = [], uri = [], value}). - --record(erlsom_sax_state, - {user_state, - callback, - encoding, %% of input document - continuation_state, - entities = [], - par_entities = [], - current_entity = '__top', - namespaces = [], - endtags = [], - output, %% determines the encoding of text and atttribute values - expand_entities = true, %% if false, user defined entities will - %% be ignored in the DTD, and use of entities - %% will fail. - max_entity_depth = 2, %% Maximum level of nesting of entities. 2 means: an - %% an entity can refer to 1 or more other entities, - %% but none of those can contain entity references. - max_entity_size = 2000, %% Maximum size of a single entity - max_nr_of_entities = 100, %% Maximum number of entities that can be defined. - %% Note that a large number can lead to long - %% processing to find cycles, unless max depth has - %% been set to a small number. - max_expanded_entity_size = 10000000, %% Maximum total number of bytes of all - %% expanded entities together. - entity_size_acc = 0, %% accumulated size of entities - continuation_fun, - %% entity_relations is used to check on circular definitions - entity_relations = []}). - -%% useful macro approach copied from xmerl --define(space, 32). --define(cr, 13). --define(lf, 10). --define(tab, 9). - -%% whitespace consists of 'space', 'carriage return', 'line feed' or 'tab' --define(is_whitespace(C), - C =:= ?space; C =:= ?cr ; C =:= ?lf; C =:= ?tab). - --define(is_namestart_char(C), - C > 96, C < 123; C > 64, C < 91; C =:= $_). - --define(is_namestart_char2(C), %% also for characters <> 7 bit asscii - C > 96, C < 123; C > 64, C < 91; C =:= $_; - C > 191, C =/= 215, C =/= 247). %% this check is far from complete! - --define(is_name_char(C), - C > 96, C < 123; - C > 64, C < 91; - C > 47, C < 58; - C =:= $_; - C =:= $-; - C =:= $.). - --define(is_name_char2(C), %% also for characters <> 7 bit ascii - C > 96, C < 123; - C > 64, C < 91; - C > 47, C < 58; - C =:= $_; - C =:= $-; - C =:= $.; - C > 191, C /= 215, C /= 247). %% this check is far from complete! diff --git a/rebar.config b/rebar.config index 01cde8d..dcb5ac3 100644 --- a/rebar.config +++ b/rebar.config @@ -10,6 +10,8 @@ %% Erlang compiler options {erl_opts, [ debug_info % , warnings_as_errors + , {i, "include"} + , {i, "deps/*/include"} ]}. diff --git a/src/gen_refac_script.erl b/src/gen_refac_script.erl index 626fcb9..b7473e4 100644 --- a/src/gen_refac_script.erl +++ b/src/gen_refac_script.erl @@ -37,9 +37,9 @@ -export([test/0, test1/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -define(Editor, emacs). diff --git a/src/gen_xsd_model.erl b/src/gen_xsd_model.erl index 47aedc8..d45d875 100644 --- a/src/gen_xsd_model.erl +++ b/src/gen_xsd_model.erl @@ -35,10 +35,10 @@ -export([test/0, test1/0, test2/0, test3/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). -include_lib("xmerl/include/xmerl.hrl"). --include("../include/wsdl20.hrl"). +-include("wsdl20.hrl"). %%@private test()-> diff --git a/src/write_data_gen.erl b/src/write_data_gen.erl index 1d8103c..04ca39f 100644 --- a/src/write_data_gen.erl +++ b/src/write_data_gen.erl @@ -39,9 +39,9 @@ -compile(export_all). --include("../include/erlsom_parse.hrl"). --includeb("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -include_lib("eqc/include/eqc.hrl"). %%@private diff --git a/src/write_eqc_statem.erl b/src/write_eqc_statem.erl index 91a71b9..ee8c1bc 100644 --- a/src/write_eqc_statem.erl +++ b/src/write_eqc_statem.erl @@ -35,9 +35,9 @@ -export([test0/0, test1/0, test2/0, test3/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -type module_name()::atom(). @@ -99,6 +99,7 @@ test3() -> write_eqc_statem(WsdlFile, XsdFile,HrlFile, SUT, Style, OutFile) -> {ok, Model} = erlsom:compile_xsd_file("../priv/wsdl20.xsd"), Model1 = erlsom:add_xsd_model(Model), +% io:format("--> ~p~n", [Model1]), Result=erlsom:parse_file(WsdlFile, Model1), case Result of {ok, Res} -> diff --git a/src/write_hrl.erl b/src/write_hrl.erl index bfdba42..95e69de 100644 --- a/src/write_hrl.erl +++ b/src/write_hrl.erl @@ -36,8 +36,8 @@ -export([test/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). -compile(export_all). diff --git a/src/write_sut_api.erl b/src/write_sut_api.erl index 311a6db..6fc0d30 100644 --- a/src/write_sut_api.erl +++ b/src/write_sut_api.erl @@ -39,9 +39,9 @@ -compile(export_all). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). vodkatv_sut() -> write_sut_api( diff --git a/src/ws_diff.erl b/src/ws_diff.erl index 49078ec..0c63289 100644 --- a/src/ws_diff.erl +++ b/src/ws_diff.erl @@ -34,9 +34,9 @@ -export([test/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -compile(export_all). diff --git a/src/ws_lib.erl b/src/ws_lib.erl index 7021698..3000835 100644 --- a/src/ws_lib.erl +++ b/src/ws_lib.erl @@ -34,8 +34,8 @@ -compile(export_all). --include("erlsom_parse.hrl"). --include("erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). is_simple_type(#type{anyAttr=Attrs})-> From 20387ed6d183cf4eff38b653f3a04116db6eecb1 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:57:23 +0200 Subject: [PATCH 03/11] Removed verbose option from Makefile compile target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5315a5b..62d8bdb 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) -v skip_deps=true compile + $(REBAR) skip_deps=true compile doc: $(REBAR) skip_deps=true doc From 397e58d31a8faf5ae0bb6bbd9e0a59d6e58a2233 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Tue, 29 Apr 2014 16:16:44 +0200 Subject: [PATCH 04/11] Removed demo file from source folder. --- src/demo.erl | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 src/demo.erl diff --git a/src/demo.erl b/src/demo.erl deleted file mode 100755 index 841ab61..0000000 --- a/src/demo.erl +++ /dev/null @@ -1,49 +0,0 @@ --module(demo). - --compile(export_all). - -gen_hrl()-> - write_hrl:write_hrl_file( - "../tests/vodkatv/vodkatv.xsd", - "vodkatv.hrl"). - -gen_eqc_statem()-> - write_eqc_statem:write_eqc_statem( - "../tests/vodkatv/vodkatv.wsdl", - "../tests/vodkatv/vodkatv.xsd", - none, - "vodkatv_sut", - tuple, - "vodkatv_eqc.erl"). - -gen_sut_api() -> - write_sut_api:write_sut_api( - none, - "../tests/vodkatv/vodkatv.wsdl", - "../tests/vodkatv/vodkatv.xsd", - "http://localhost:8082/vodkatv/", - "vodkatv_sut.erl"). - - -gen_diff() -> - ws_diff:gen_diff("../tests/vodkatv-wsdl-evolution/2014-01-29", - "../tests/vodkatv-wsdl-evolution/2014-02-17"). - - -gen_refac_script() -> - gen_refac_script:gen_refac_script( - {"../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd"}, - {"../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.xsd"}, - "refac_script.erl"). - - -gen_eqc_statem_140129()-> - write_eqc_statem:write_eqc_statem( - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd", - none, - "vodkatv_sut", - non_tuple, - "vodkatv_eqc_140129.erl"). From 52981fceccf2aa4c9733f8a0cedcc6ef05a0b99a Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:53:17 +0200 Subject: [PATCH 05/11] Enforced use of erlsom in deps. --- Makefile | 2 +- include/erlsom.hrl | 27 ----------- include/erlsom_compile.hrl | 91 -------------------------------------- include/erlsom_parse.hrl | 72 ------------------------------ include/erlsom_sax.hrl | 90 ------------------------------------- rebar.config | 2 + src/gen_refac_script.erl | 6 +-- src/gen_xsd_model.erl | 6 +-- src/write_data_gen.erl | 6 +-- src/write_eqc_statem.erl | 7 +-- src/write_hrl.erl | 4 +- src/write_sut_api.erl | 6 +-- src/ws_diff.erl | 6 +-- src/ws_lib.erl | 4 +- 14 files changed, 26 insertions(+), 303 deletions(-) delete mode 100644 include/erlsom.hrl delete mode 100644 include/erlsom_compile.hrl delete mode 100644 include/erlsom_parse.hrl delete mode 100644 include/erlsom_sax.hrl diff --git a/Makefile b/Makefile index 62d8bdb..5315a5b 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) skip_deps=true compile + $(REBAR) -v skip_deps=true compile doc: $(REBAR) skip_deps=true doc diff --git a/include/erlsom.hrl b/include/erlsom.hrl deleted file mode 100644 index e3b520f..0000000 --- a/include/erlsom.hrl +++ /dev/null @@ -1,27 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% Header file for erlsom -%%% ==================================================================== - -%% prefix=the prefix that will be used in the result --record(ns, {uri, prefix}). --record(qname, {uri, localPart, prefix, mappedPrefix}). diff --git a/include/erlsom_compile.hrl b/include/erlsom_compile.hrl deleted file mode 100644 index 18c13ea..0000000 --- a/include/erlsom_compile.hrl +++ /dev/null @@ -1,91 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% Header file for erlsom_compile -%%% ==================================================================== - - -%% records for the structures as found in the XSD --record(schemaType, - {elInfo, targetNamespace, elementFormDefault, attributeFormDefault, blockDefault, finalDefault, - version, id, imports, elements}). --record(importType, {elInfo, id, namespace, schemaLocation, annotation}). --record(includeType, {elInfo, id, schemaLocation, annotation}). --record(redefineType, {elInfo, id, schemaLocation, elements}). --record(globalElementType, {elInfo, name, type, default, fixed, id, abstract, substitutionGroup, final, nillable, - annotation, simpleOrComplex, unique}). --record(localElementType, {elInfo, name, type, default, fixed, form, ref, minOccurs, maxOccurs, nillable, annotation, - simpleOrComplex, unique}). --record(globalComplexTypeType, {elInfo, name, final, abstract, block, mixed, id, annotation, model, attributes, anyAttribute}). --record(localComplexTypeType, {elInfo, mixed, annotation, model, attributes, anyAttribute}). --record(globalSimpleTypeType, {elInfo, name, id, annotation, model}). --record(localSimpleTypeType, {elInfo, annotation, model}). --record(simpleContentType, {elInfo, annotation, model, id}). --record(groupDefType, {elInfo, name, annotation, model}). --record(groupRefType, {elInfo, ref, minOccurs, maxOccurs}). --record(annotationType, {elInfo, annotation}). --record(globalAttributeType, {elInfo, name, type, use, fixed, default, id, model}). --record(localAttributeType, {elInfo, name, type, use, ref, fixed, form, default, model}). --record(choiceType, {elInfo, id, minOccurs, maxOccurs, annotation, alternatives}). --record(sequenceType, {elInfo, annotation, elements, minOccurs, maxOccurs}). --record(allType, {elInfo, annotation, elements, minOccurs, maxOccurs}). --record(attributeGroupDefType, {elInfo, id, name, annotation, attributes, anyAttribute}). --record(attributeGroupRefType, {elInfo, ref, id}). --record(anyType, {elInfo, any, minOccurs, maxOccurs, namespace, processContents}). --record(anyAttributeType, {elInfo, id, namespace, processContents, annotation}). --record(extensionType, {elInfo, base, annotation, attributes, anyAttribute}). --record(extensionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}). --record(restrictionType, {elInfo, annotation, any, attributes, anyAttribute, base}). --record(restrictionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}). --record(complexContentType, {elInfo, annotation, model, mixed}). - -%% This is added to the XSD to allow generation of an XML document --record(namespaceType, {prefix, 'URI'}). - -%% the rest is for internal use in the translation of the XSD to the -%% format used by the parser -%% path is used to give local elements a unique name (the 'path' to the element) --record(schemaInfo, {targetNamespace, elementFormDefault, namespacePrefix, namespaces, path=[], attGrps, atts, th}). - -%% typeInfo - the intermediate format. -%% global (true or false): we need to find out in the -%% end whether this type should be available as 'top level' element in the -%% xml document. --record(typeInfo, {typeName, - global, - typeType, - typeRef, - elements, - attributes = [], - anyAttr, - seqOrAll, - extends, - restricts, - mixed, - base, - substitutionGroup, - min = 1, - max = 1}). - --record(elementInfo, {alternatives, min = 1, max = 1, nillable}). --record(alternative, {tag, type, real, min = 1, max = 1, anyInfo}). --record(attrib, {name, optional, type, ref}). --record(attGrp, {name, atts, anyAttr}). diff --git a/include/erlsom_parse.hrl b/include/erlsom_parse.hrl deleted file mode 100644 index f34fff8..0000000 --- a/include/erlsom_parse.hrl +++ /dev/null @@ -1,72 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% header file for erslom_parse -%%% ==================================================================== - -%% header file for erlsom_parse. Contains the record definitions. - -%% the records that form the model - see erlsom_parse.erl for a -%% description. - --record(model, {tps, nss, - tns, %% target namespace (the URI, a string) - th %% type hierarchy, see 'tree'-functions in erlsom_lib - }). --record(type, {nm, tp = sequence, els, atts = [], anyAttr, nillable, nr, - mn = 1, mx = 1, mxd = false, %% mn & mx are only used by erlsom_compile - typeName}). - %% typeName is the 'real' name, to be used in xsi:type attributes - %% for derived types. The 'nm' field is actually a key, which may - %% include an additional prefix to differntiate between elements, types - %% and groups. --record(el, {alts, mn = 1, mx = 1, nillable, nr}). --record(alt, {tag, tp, nxt = [], mn = 1, mx = 1, rl = true, anyInfo}). --record(att, {nm, nr, opt, tp}). -%% -record(ns, {uri, pf}). --record(elInfo, {anyAttr}). --record(anyAttr, {prCont, ns, tns}). %% for anyAttributes --record(anyInfo, {prCont, ns, tns}). %% for any elements - --record(state, {currentState, resultSoFar, model, namespaces, - allNamespaces, continuationState}). - --record(cs, {re, %% remaining elements - sf, %% nr of elements of the current type received so far - er, %% element record: the result (so far) for this type - rl, %% 'real element': do we expect an end-tag? - mxd}). %% is this a mixed type? - --record(all, {re, %% remaining elements - nr, %% the sequence number of the current element - er}). %% element record: the result (so far) for this type - -%% altState is used for parsing alternatives within -%% a choice that can occur more than once --record(altState, {name, %% the tag we are processing - type, %% the type of this element - real, %% is this a 'real' element or a group ref - receivedSoFar, %% number of elements received - acc, %% values of elements already processed - min, %% minOccurs - max}). %% maxOccurs - --record(anyState, {anyInfo}). diff --git a/include/erlsom_sax.hrl b/include/erlsom_sax.hrl deleted file mode 100644 index 4d6ad06..0000000 --- a/include/erlsom_sax.hrl +++ /dev/null @@ -1,90 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% data structures produced by erlsom_sax -%%% ==================================================================== - -%% data structures produced by sax.erl. - --record(attribute, {localName, prefix = [], uri = [], value}). - --record(erlsom_sax_state, - {user_state, - callback, - encoding, %% of input document - continuation_state, - entities = [], - par_entities = [], - current_entity = '__top', - namespaces = [], - endtags = [], - output, %% determines the encoding of text and atttribute values - expand_entities = true, %% if false, user defined entities will - %% be ignored in the DTD, and use of entities - %% will fail. - max_entity_depth = 2, %% Maximum level of nesting of entities. 2 means: an - %% an entity can refer to 1 or more other entities, - %% but none of those can contain entity references. - max_entity_size = 2000, %% Maximum size of a single entity - max_nr_of_entities = 100, %% Maximum number of entities that can be defined. - %% Note that a large number can lead to long - %% processing to find cycles, unless max depth has - %% been set to a small number. - max_expanded_entity_size = 10000000, %% Maximum total number of bytes of all - %% expanded entities together. - entity_size_acc = 0, %% accumulated size of entities - continuation_fun, - %% entity_relations is used to check on circular definitions - entity_relations = []}). - -%% useful macro approach copied from xmerl --define(space, 32). --define(cr, 13). --define(lf, 10). --define(tab, 9). - -%% whitespace consists of 'space', 'carriage return', 'line feed' or 'tab' --define(is_whitespace(C), - C =:= ?space; C =:= ?cr ; C =:= ?lf; C =:= ?tab). - --define(is_namestart_char(C), - C > 96, C < 123; C > 64, C < 91; C =:= $_). - --define(is_namestart_char2(C), %% also for characters <> 7 bit asscii - C > 96, C < 123; C > 64, C < 91; C =:= $_; - C > 191, C =/= 215, C =/= 247). %% this check is far from complete! - --define(is_name_char(C), - C > 96, C < 123; - C > 64, C < 91; - C > 47, C < 58; - C =:= $_; - C =:= $-; - C =:= $.). - --define(is_name_char2(C), %% also for characters <> 7 bit ascii - C > 96, C < 123; - C > 64, C < 91; - C > 47, C < 58; - C =:= $_; - C =:= $-; - C =:= $.; - C > 191, C /= 215, C /= 247). %% this check is far from complete! diff --git a/rebar.config b/rebar.config index 01cde8d..dcb5ac3 100644 --- a/rebar.config +++ b/rebar.config @@ -10,6 +10,8 @@ %% Erlang compiler options {erl_opts, [ debug_info % , warnings_as_errors + , {i, "include"} + , {i, "deps/*/include"} ]}. diff --git a/src/gen_refac_script.erl b/src/gen_refac_script.erl index 626fcb9..b7473e4 100644 --- a/src/gen_refac_script.erl +++ b/src/gen_refac_script.erl @@ -37,9 +37,9 @@ -export([test/0, test1/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -define(Editor, emacs). diff --git a/src/gen_xsd_model.erl b/src/gen_xsd_model.erl index 47aedc8..d45d875 100644 --- a/src/gen_xsd_model.erl +++ b/src/gen_xsd_model.erl @@ -35,10 +35,10 @@ -export([test/0, test1/0, test2/0, test3/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). -include_lib("xmerl/include/xmerl.hrl"). --include("../include/wsdl20.hrl"). +-include("wsdl20.hrl"). %%@private test()-> diff --git a/src/write_data_gen.erl b/src/write_data_gen.erl index 831986e..50b38a1 100644 --- a/src/write_data_gen.erl +++ b/src/write_data_gen.erl @@ -39,9 +39,9 @@ -compile(export_all). --include("../include/erlsom_parse.hrl"). --includeb("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -include_lib("eqc/include/eqc.hrl"). %%@private diff --git a/src/write_eqc_statem.erl b/src/write_eqc_statem.erl index c62f2ac..23a662a 100644 --- a/src/write_eqc_statem.erl +++ b/src/write_eqc_statem.erl @@ -35,9 +35,9 @@ -export([test0/0, test1/0, test2/0, test3/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -type module_name()::atom(). @@ -99,6 +99,7 @@ test3() -> write_eqc_statem(WsdlFile, XsdFile,HrlFile, SUT, Style, OutFile) -> {ok, Model} = erlsom:compile_xsd_file("../priv/wsdl20.xsd"), Model1 = erlsom:add_xsd_model(Model), +% io:format("--> ~p~n", [Model1]), Result=erlsom:parse_file(WsdlFile, Model1), case Result of {ok, Res} -> diff --git a/src/write_hrl.erl b/src/write_hrl.erl index 9f255c3..764b80c 100644 --- a/src/write_hrl.erl +++ b/src/write_hrl.erl @@ -36,8 +36,8 @@ -export([test/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). -compile(export_all). diff --git a/src/write_sut_api.erl b/src/write_sut_api.erl index 311a6db..6fc0d30 100644 --- a/src/write_sut_api.erl +++ b/src/write_sut_api.erl @@ -39,9 +39,9 @@ -compile(export_all). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). vodkatv_sut() -> write_sut_api( diff --git a/src/ws_diff.erl b/src/ws_diff.erl index 49078ec..0c63289 100644 --- a/src/ws_diff.erl +++ b/src/ws_diff.erl @@ -34,9 +34,9 @@ -export([test/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -compile(export_all). diff --git a/src/ws_lib.erl b/src/ws_lib.erl index 7021698..3000835 100644 --- a/src/ws_lib.erl +++ b/src/ws_lib.erl @@ -34,8 +34,8 @@ -compile(export_all). --include("erlsom_parse.hrl"). --include("erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). is_simple_type(#type{anyAttr=Attrs})-> From 11a0bd71504233e6dc9ec81abc88eca2d2b0d596 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:57:23 +0200 Subject: [PATCH 06/11] Removed verbose option from Makefile compile target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5315a5b..62d8bdb 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) -v skip_deps=true compile + $(REBAR) skip_deps=true compile doc: $(REBAR) skip_deps=true doc From 9aba05d6f4c8fa95a0ace3dfafc270f34d70db29 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Tue, 29 Apr 2014 16:16:44 +0200 Subject: [PATCH 07/11] Removed demo file from source folder. --- src/demo.erl | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100755 src/demo.erl diff --git a/src/demo.erl b/src/demo.erl deleted file mode 100755 index 841ab61..0000000 --- a/src/demo.erl +++ /dev/null @@ -1,49 +0,0 @@ --module(demo). - --compile(export_all). - -gen_hrl()-> - write_hrl:write_hrl_file( - "../tests/vodkatv/vodkatv.xsd", - "vodkatv.hrl"). - -gen_eqc_statem()-> - write_eqc_statem:write_eqc_statem( - "../tests/vodkatv/vodkatv.wsdl", - "../tests/vodkatv/vodkatv.xsd", - none, - "vodkatv_sut", - tuple, - "vodkatv_eqc.erl"). - -gen_sut_api() -> - write_sut_api:write_sut_api( - none, - "../tests/vodkatv/vodkatv.wsdl", - "../tests/vodkatv/vodkatv.xsd", - "http://localhost:8082/vodkatv/", - "vodkatv_sut.erl"). - - -gen_diff() -> - ws_diff:gen_diff("../tests/vodkatv-wsdl-evolution/2014-01-29", - "../tests/vodkatv-wsdl-evolution/2014-02-17"). - - -gen_refac_script() -> - gen_refac_script:gen_refac_script( - {"../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd"}, - {"../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-02-17/vodkatv.xsd"}, - "refac_script.erl"). - - -gen_eqc_statem_140129()-> - write_eqc_statem:write_eqc_statem( - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.wsdl", - "../tests/vodkatv-wsdl-evolution/2014-01-29/vodkatv.xsd", - none, - "vodkatv_sut", - non_tuple, - "vodkatv_eqc_140129.erl"). From 237f0ce37b8847abad6011863078def93becafd8 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:53:17 +0200 Subject: [PATCH 08/11] Enforced use of erlsom in deps. --- Makefile | 2 +- include/erlsom.hrl | 27 ----------- include/erlsom_compile.hrl | 91 -------------------------------------- include/erlsom_parse.hrl | 72 ------------------------------ include/erlsom_sax.hrl | 90 ------------------------------------- rebar.config | 2 + src/gen_refac_script.erl | 6 +-- src/gen_xsd_model.erl | 6 +-- src/write_data_gen.erl | 6 +-- src/write_eqc_statem.erl | 7 +-- src/write_hrl.erl | 4 +- src/write_sut_api.erl | 6 +-- src/ws_diff.erl | 6 +-- src/ws_lib.erl | 4 +- 14 files changed, 26 insertions(+), 303 deletions(-) delete mode 100644 include/erlsom.hrl delete mode 100644 include/erlsom_compile.hrl delete mode 100644 include/erlsom_parse.hrl delete mode 100644 include/erlsom_sax.hrl diff --git a/Makefile b/Makefile index 62d8bdb..5315a5b 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) skip_deps=true compile + $(REBAR) -v skip_deps=true compile doc: $(REBAR) skip_deps=true doc diff --git a/include/erlsom.hrl b/include/erlsom.hrl deleted file mode 100644 index e3b520f..0000000 --- a/include/erlsom.hrl +++ /dev/null @@ -1,27 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% Header file for erlsom -%%% ==================================================================== - -%% prefix=the prefix that will be used in the result --record(ns, {uri, prefix}). --record(qname, {uri, localPart, prefix, mappedPrefix}). diff --git a/include/erlsom_compile.hrl b/include/erlsom_compile.hrl deleted file mode 100644 index 18c13ea..0000000 --- a/include/erlsom_compile.hrl +++ /dev/null @@ -1,91 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% Header file for erlsom_compile -%%% ==================================================================== - - -%% records for the structures as found in the XSD --record(schemaType, - {elInfo, targetNamespace, elementFormDefault, attributeFormDefault, blockDefault, finalDefault, - version, id, imports, elements}). --record(importType, {elInfo, id, namespace, schemaLocation, annotation}). --record(includeType, {elInfo, id, schemaLocation, annotation}). --record(redefineType, {elInfo, id, schemaLocation, elements}). --record(globalElementType, {elInfo, name, type, default, fixed, id, abstract, substitutionGroup, final, nillable, - annotation, simpleOrComplex, unique}). --record(localElementType, {elInfo, name, type, default, fixed, form, ref, minOccurs, maxOccurs, nillable, annotation, - simpleOrComplex, unique}). --record(globalComplexTypeType, {elInfo, name, final, abstract, block, mixed, id, annotation, model, attributes, anyAttribute}). --record(localComplexTypeType, {elInfo, mixed, annotation, model, attributes, anyAttribute}). --record(globalSimpleTypeType, {elInfo, name, id, annotation, model}). --record(localSimpleTypeType, {elInfo, annotation, model}). --record(simpleContentType, {elInfo, annotation, model, id}). --record(groupDefType, {elInfo, name, annotation, model}). --record(groupRefType, {elInfo, ref, minOccurs, maxOccurs}). --record(annotationType, {elInfo, annotation}). --record(globalAttributeType, {elInfo, name, type, use, fixed, default, id, model}). --record(localAttributeType, {elInfo, name, type, use, ref, fixed, form, default, model}). --record(choiceType, {elInfo, id, minOccurs, maxOccurs, annotation, alternatives}). --record(sequenceType, {elInfo, annotation, elements, minOccurs, maxOccurs}). --record(allType, {elInfo, annotation, elements, minOccurs, maxOccurs}). --record(attributeGroupDefType, {elInfo, id, name, annotation, attributes, anyAttribute}). --record(attributeGroupRefType, {elInfo, ref, id}). --record(anyType, {elInfo, any, minOccurs, maxOccurs, namespace, processContents}). --record(anyAttributeType, {elInfo, id, namespace, processContents, annotation}). --record(extensionType, {elInfo, base, annotation, attributes, anyAttribute}). --record(extensionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}). --record(restrictionType, {elInfo, annotation, any, attributes, anyAttribute, base}). --record(restrictionTypeC, {elInfo, base, annotation, model, attributes, anyAttribute}). --record(complexContentType, {elInfo, annotation, model, mixed}). - -%% This is added to the XSD to allow generation of an XML document --record(namespaceType, {prefix, 'URI'}). - -%% the rest is for internal use in the translation of the XSD to the -%% format used by the parser -%% path is used to give local elements a unique name (the 'path' to the element) --record(schemaInfo, {targetNamespace, elementFormDefault, namespacePrefix, namespaces, path=[], attGrps, atts, th}). - -%% typeInfo - the intermediate format. -%% global (true or false): we need to find out in the -%% end whether this type should be available as 'top level' element in the -%% xml document. --record(typeInfo, {typeName, - global, - typeType, - typeRef, - elements, - attributes = [], - anyAttr, - seqOrAll, - extends, - restricts, - mixed, - base, - substitutionGroup, - min = 1, - max = 1}). - --record(elementInfo, {alternatives, min = 1, max = 1, nillable}). --record(alternative, {tag, type, real, min = 1, max = 1, anyInfo}). --record(attrib, {name, optional, type, ref}). --record(attGrp, {name, atts, anyAttr}). diff --git a/include/erlsom_parse.hrl b/include/erlsom_parse.hrl deleted file mode 100644 index f34fff8..0000000 --- a/include/erlsom_parse.hrl +++ /dev/null @@ -1,72 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% header file for erslom_parse -%%% ==================================================================== - -%% header file for erlsom_parse. Contains the record definitions. - -%% the records that form the model - see erlsom_parse.erl for a -%% description. - --record(model, {tps, nss, - tns, %% target namespace (the URI, a string) - th %% type hierarchy, see 'tree'-functions in erlsom_lib - }). --record(type, {nm, tp = sequence, els, atts = [], anyAttr, nillable, nr, - mn = 1, mx = 1, mxd = false, %% mn & mx are only used by erlsom_compile - typeName}). - %% typeName is the 'real' name, to be used in xsi:type attributes - %% for derived types. The 'nm' field is actually a key, which may - %% include an additional prefix to differntiate between elements, types - %% and groups. --record(el, {alts, mn = 1, mx = 1, nillable, nr}). --record(alt, {tag, tp, nxt = [], mn = 1, mx = 1, rl = true, anyInfo}). --record(att, {nm, nr, opt, tp}). -%% -record(ns, {uri, pf}). --record(elInfo, {anyAttr}). --record(anyAttr, {prCont, ns, tns}). %% for anyAttributes --record(anyInfo, {prCont, ns, tns}). %% for any elements - --record(state, {currentState, resultSoFar, model, namespaces, - allNamespaces, continuationState}). - --record(cs, {re, %% remaining elements - sf, %% nr of elements of the current type received so far - er, %% element record: the result (so far) for this type - rl, %% 'real element': do we expect an end-tag? - mxd}). %% is this a mixed type? - --record(all, {re, %% remaining elements - nr, %% the sequence number of the current element - er}). %% element record: the result (so far) for this type - -%% altState is used for parsing alternatives within -%% a choice that can occur more than once --record(altState, {name, %% the tag we are processing - type, %% the type of this element - real, %% is this a 'real' element or a group ref - receivedSoFar, %% number of elements received - acc, %% values of elements already processed - min, %% minOccurs - max}). %% maxOccurs - --record(anyState, {anyInfo}). diff --git a/include/erlsom_sax.hrl b/include/erlsom_sax.hrl deleted file mode 100644 index 4d6ad06..0000000 --- a/include/erlsom_sax.hrl +++ /dev/null @@ -1,90 +0,0 @@ -%%% Copyright (C) 2006 - 2008 Willem de Jong -%%% -%%% This file is part of Erlsom. -%%% -%%% Erlsom is free software: you can redistribute it and/or modify -%%% it under the terms of the GNU Lesser General Public License as -%%% published by the Free Software Foundation, either version 3 of -%%% the License, or (at your option) any later version. -%%% -%%% Erlsom is distributed in the hope that it will be useful, -%%% but WITHOUT ANY WARRANTY; without even the implied warranty of -%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -%%% GNU Lesser General Public License for more details. -%%% -%%% You should have received a copy of the GNU Lesser General Public -%%% License along with Erlsom. If not, see -%%% . -%%% -%%% Author contact: w.a.de.jong@gmail.com - -%%% ==================================================================== -%%% data structures produced by erlsom_sax -%%% ==================================================================== - -%% data structures produced by sax.erl. - --record(attribute, {localName, prefix = [], uri = [], value}). - --record(erlsom_sax_state, - {user_state, - callback, - encoding, %% of input document - continuation_state, - entities = [], - par_entities = [], - current_entity = '__top', - namespaces = [], - endtags = [], - output, %% determines the encoding of text and atttribute values - expand_entities = true, %% if false, user defined entities will - %% be ignored in the DTD, and use of entities - %% will fail. - max_entity_depth = 2, %% Maximum level of nesting of entities. 2 means: an - %% an entity can refer to 1 or more other entities, - %% but none of those can contain entity references. - max_entity_size = 2000, %% Maximum size of a single entity - max_nr_of_entities = 100, %% Maximum number of entities that can be defined. - %% Note that a large number can lead to long - %% processing to find cycles, unless max depth has - %% been set to a small number. - max_expanded_entity_size = 10000000, %% Maximum total number of bytes of all - %% expanded entities together. - entity_size_acc = 0, %% accumulated size of entities - continuation_fun, - %% entity_relations is used to check on circular definitions - entity_relations = []}). - -%% useful macro approach copied from xmerl --define(space, 32). --define(cr, 13). --define(lf, 10). --define(tab, 9). - -%% whitespace consists of 'space', 'carriage return', 'line feed' or 'tab' --define(is_whitespace(C), - C =:= ?space; C =:= ?cr ; C =:= ?lf; C =:= ?tab). - --define(is_namestart_char(C), - C > 96, C < 123; C > 64, C < 91; C =:= $_). - --define(is_namestart_char2(C), %% also for characters <> 7 bit asscii - C > 96, C < 123; C > 64, C < 91; C =:= $_; - C > 191, C =/= 215, C =/= 247). %% this check is far from complete! - --define(is_name_char(C), - C > 96, C < 123; - C > 64, C < 91; - C > 47, C < 58; - C =:= $_; - C =:= $-; - C =:= $.). - --define(is_name_char2(C), %% also for characters <> 7 bit ascii - C > 96, C < 123; - C > 64, C < 91; - C > 47, C < 58; - C =:= $_; - C =:= $-; - C =:= $.; - C > 191, C /= 215, C /= 247). %% this check is far from complete! diff --git a/rebar.config b/rebar.config index 01cde8d..dcb5ac3 100644 --- a/rebar.config +++ b/rebar.config @@ -10,6 +10,8 @@ %% Erlang compiler options {erl_opts, [ debug_info % , warnings_as_errors + , {i, "include"} + , {i, "deps/*/include"} ]}. diff --git a/src/gen_refac_script.erl b/src/gen_refac_script.erl index 626fcb9..b7473e4 100644 --- a/src/gen_refac_script.erl +++ b/src/gen_refac_script.erl @@ -37,9 +37,9 @@ -export([test/0, test1/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -define(Editor, emacs). diff --git a/src/gen_xsd_model.erl b/src/gen_xsd_model.erl index 47aedc8..d45d875 100644 --- a/src/gen_xsd_model.erl +++ b/src/gen_xsd_model.erl @@ -35,10 +35,10 @@ -export([test/0, test1/0, test2/0, test3/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). -include_lib("xmerl/include/xmerl.hrl"). --include("../include/wsdl20.hrl"). +-include("wsdl20.hrl"). %%@private test()-> diff --git a/src/write_data_gen.erl b/src/write_data_gen.erl index 831986e..50b38a1 100644 --- a/src/write_data_gen.erl +++ b/src/write_data_gen.erl @@ -39,9 +39,9 @@ -compile(export_all). --include("../include/erlsom_parse.hrl"). --includeb("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -include_lib("eqc/include/eqc.hrl"). %%@private diff --git a/src/write_eqc_statem.erl b/src/write_eqc_statem.erl index c62f2ac..23a662a 100644 --- a/src/write_eqc_statem.erl +++ b/src/write_eqc_statem.erl @@ -35,9 +35,9 @@ -export([test0/0, test1/0, test2/0, test3/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -type module_name()::atom(). @@ -99,6 +99,7 @@ test3() -> write_eqc_statem(WsdlFile, XsdFile,HrlFile, SUT, Style, OutFile) -> {ok, Model} = erlsom:compile_xsd_file("../priv/wsdl20.xsd"), Model1 = erlsom:add_xsd_model(Model), +% io:format("--> ~p~n", [Model1]), Result=erlsom:parse_file(WsdlFile, Model1), case Result of {ok, Res} -> diff --git a/src/write_hrl.erl b/src/write_hrl.erl index 9f255c3..764b80c 100644 --- a/src/write_hrl.erl +++ b/src/write_hrl.erl @@ -36,8 +36,8 @@ -export([test/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). -compile(export_all). diff --git a/src/write_sut_api.erl b/src/write_sut_api.erl index 311a6db..6fc0d30 100644 --- a/src/write_sut_api.erl +++ b/src/write_sut_api.erl @@ -39,9 +39,9 @@ -compile(export_all). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). vodkatv_sut() -> write_sut_api( diff --git a/src/ws_diff.erl b/src/ws_diff.erl index 49078ec..0c63289 100644 --- a/src/ws_diff.erl +++ b/src/ws_diff.erl @@ -34,9 +34,9 @@ -export([test/0]). --include("../include/erlsom_parse.hrl"). --include("../include/erlsom.hrl"). --include("../include/wsdl20.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). +-include("wsdl20.hrl"). -compile(export_all). diff --git a/src/ws_lib.erl b/src/ws_lib.erl index 7021698..3000835 100644 --- a/src/ws_lib.erl +++ b/src/ws_lib.erl @@ -34,8 +34,8 @@ -compile(export_all). --include("erlsom_parse.hrl"). --include("erlsom.hrl"). +-include_lib("erlsom/include/erlsom_parse.hrl"). +-include_lib("erlsom/include/erlsom.hrl"). is_simple_type(#type{anyAttr=Attrs})-> From ccdb397461f8c6d729576880fdf078bf72c22a61 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:57:23 +0200 Subject: [PATCH 09/11] Removed verbose option from Makefile compile target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5315a5b..62d8bdb 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) -v skip_deps=true compile + $(REBAR) skip_deps=true compile doc: $(REBAR) skip_deps=true doc From 672ce7d8b14dae00b5feff89d501bc2216ee26da Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:53:17 +0200 Subject: [PATCH 10/11] Enforced use of erlsom in deps. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 62d8bdb..5315a5b 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) skip_deps=true compile + $(REBAR) -v skip_deps=true compile doc: $(REBAR) skip_deps=true doc From 0efa2f7ec7c003ed88ee44914a35a9515bc96195 Mon Sep 17 00:00:00 2001 From: "Laura M. Castro" Date: Thu, 1 May 2014 01:57:23 +0200 Subject: [PATCH 11/11] Removed verbose option from Makefile compile target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5315a5b..62d8bdb 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ update-deps: $(REBAR) compile compile: - $(REBAR) -v skip_deps=true compile + $(REBAR) skip_deps=true compile doc: $(REBAR) skip_deps=true doc