Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const APModelManager = require('@accordproject/ergo-compiler').APModelManager;
const Field = require('@accordproject/concerto-core').Field;
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const util = require('util');
const debug = require('debug')('cicero-core:grammarvisitor');
/**
* Converts concerto models and types to Nearley rules
*
* @private
* @class
*/
class GrammarVisitor {
/**
* Visitor design pattern
* @param {Object} thing - the object being visited
* @param {Object} parameters - the parameter
* @return {Object} the result of visiting or null
* @private
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const ModelManager = require('@accordproject/concerto-core').ModelManager;
const ModelUtil = require('@accordproject/concerto-core').ModelUtil;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const Field = require('@accordproject/concerto-core').Field;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
/**
* Convert the contents of a ModelManager
* to an XML Schema.
* Set a fileWriter property (instance of FileWriter) on the parameters
* object to control where the generated code is written to disk.
*
* @private
* @class
* @memberof module:concerto-tools
*/
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const EmptyPlugin = require('./emptyplugin');
const ModelManager = require('@accordproject/concerto-core').ModelManager;
const ModelUtil = require('@accordproject/concerto-core').ModelUtil;
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const Field = require('@accordproject/concerto-core').Field;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
const util = require('util');
/**
* Convert the contents of a ModelManager to Java code.
* Set a fileWriter property (instance of FileWriter) on the parameters
* object to control where the generated code is written to disk.
*
* @private
* @class
* @memberof module:concerto-tools
*/
class JavaVisitor {
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const ModelManager = require('@accordproject/concerto-core').ModelManager;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const TransactionDeclaration = require('@accordproject/concerto-core').TransactionDeclaration;
const AssetDeclaration = require('@accordproject/concerto-core').AssetDeclaration;
const ParticipantDeclaration = require('@accordproject/concerto-core').ParticipantDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const Field = require('@accordproject/concerto-core').Field;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
/**
* Convert the contents of a ModelManager
* to PlantUML format files.
* Set a fileWriter property (instance of FileWriter) on the parameters
* object to control where the generated code is written to disk.
*
* @private
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const AssetDeclaration = require('@accordproject/concerto-core').AssetDeclaration;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const ConceptDeclaration = require('@accordproject/concerto-core').ConceptDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
const Field = require('@accordproject/concerto-core').Field;
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const ModelManager = require('@accordproject/concerto-core').ModelManager;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const TransactionDeclaration = require('@accordproject/concerto-core').TransactionDeclaration;
const debug = require('debug')('concerto-core:jsonschemavisitor');
const util = require('util');
/**
* Convert the contents of a {@link ModelManager} instance to a set of JSON
* Schema v4 files - one per concrete asset and transaction type.
* Set a fileWriter property (instance of {@link FileWriter}) on the parameters
* object to control where the generated code is written to disk.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const ModelManager = require('@accordproject/concerto-core').ModelManager;
const ModelUtil = require('@accordproject/concerto-core').ModelUtil;
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const Field = require('@accordproject/concerto-core').Field;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
const util = require('util');
/**
* Convert the contents of a ModelManager to TypeScript code.
* All generated code is placed into the 'main' package. Set a
* fileWriter property (instance of FileWriter) on the parameters
* object to control where the generated code is written to disk.
*
* @private
* @class
* @memberof module:concerto-tools
*/
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
const AssetDeclaration = require('@accordproject/concerto-core').AssetDeclaration;
const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const ConceptDeclaration = require('@accordproject/concerto-core').ConceptDeclaration;
const EnumValueDeclaration = require('@accordproject/concerto-core').EnumValueDeclaration;
const Field = require('@accordproject/concerto-core').Field;
const ModelFile = require('@accordproject/concerto-core').ModelFile;
const ModelManager = require('@accordproject/concerto-core').ModelManager;
const RelationshipDeclaration = require('@accordproject/concerto-core').RelationshipDeclaration;
const TransactionDeclaration = require('@accordproject/concerto-core').TransactionDeclaration;
const util = require('util');
const ModelUtil = require('@accordproject/concerto-core').ModelUtil;
/**
* Convert the contents of a ModelManager to Go Lang code.
* All generated code is placed into the 'main' package. Set a
* fileWriter property (instance of FileWriter) on the parameters
* object to control where the generated code is written to disk.
*