public static AValueExport newAValueExport(ILexLocation location, List<ILexNameToken> nameList, PType type) { AValueExport result = new AValueExport(); result.setLocation(location); result.setNameList(nameList); result.setExportType(type); return result; }
/** * Returns a deep clone of this {@link AValueExport} node. * @return a deep clone of this {@link AValueExport} node */ public AValueExport clone() { return new AValueExport( _location, cloneList(_definition), cloneList(_nameList), _exportType ); }
/** * Creates a new complete constructor {@code AValueExport} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param nameList_ the {@link NodeList} node for the {@code nameList} child of this {@link AValueExport} node * @param exportType_ the {@link PType} <b>graph</a> node for the {@code exportType} child of this {@link AValueExport} node. * <i>The parent of this {@code exportType } will not be changed by adding it to this node.</i> */ public AValueExport(ILexLocation location_, List<? extends PDefinition> definition_, List<? extends ILexNameToken> nameList_, PType exportType_) { super(location_,definition_); this.setNameList(nameList_); this.setExportType(exportType_); }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) node.getExportType().apply(this, question);
@Override public Collection<? extends PDefinition> caseAValueExport(AValueExport exp) throws AnalysisException { List<PDefinition> list = new Vector<PDefinition>(); for (ILexNameToken name : exp.getNameList()) { list.add(AstFactory.newALocalDefinition(name.getLocation(), name.clone(), NameScope.GLOBAL, exp.getExportType())); // new ALocalDefinition(name.location, NameScope.GLOBAL,true,null, // new AAccessSpecifierAccessSpecifier(new APublicAccess(),new TStatic(),null), // ((AValueExport)exp).getExportType(),true,name.clone())); } return list; }
PType type = question.assistantFactory.createPTypeAssistant().typeResolve(exp.getExportType().clone(), null, THIS, question); exp.setExportType(type); for (ILexNameToken name : exp.getNameList())
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) node.getExportType().apply(this);
@Override public SExportIR caseAValueExport(AValueExport node, IRInfo question) throws AnalysisException { AValueExportIR valueExportCg = new AValueExportIR(); valueExportCg.setNameList(consNames(node.getNameList())); valueExportCg.setExportType(consExportType(node.getExportType(), question)); return addDecl(node, valueExportCg, question); }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) node.getExportType().apply(this);
@Override public Collection<? extends PDefinition> caseAValueExport(AValueExport exp, LinkedList<PDefinition> actualDefs) throws AnalysisException { List<PDefinition> list = new Vector<PDefinition>(); for (ILexNameToken name : exp.getNameList()) { PDefinition def = af.createPDefinitionListAssistant().findName(actualDefs, name, NameScope.NAMES); PType type = exp.getExportType().clone(); if (def != null) { if (def instanceof AUntypedDefinition) { AUntypedDefinition untyped = (AUntypedDefinition) def; list.add(AstFactory.newALocalDefinition(untyped.getLocation(), untyped.getName(), NameScope.GLOBAL, type)); // new ALocalDefinition(untyped.getLocation(), NameScope.GLOBAL, // false,null,PAccessSpecifierAssistant.getDefault(),type, false,untyped.getName())); } else { list.add(def); } } } return list; }
/** * Creates a deep clone of this {@link AValueExport} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AValueExport} node */ public AValueExport clone(Map<INode,INode> oldToNewMap) { AValueExport node = new AValueExport( _location, cloneList(_definition, oldToNewMap), cloneList(_nameList, oldToNewMap), _exportType ); oldToNewMap.put(this, node); return node; }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) mergeReturns(retVal,node.getExportType().apply(this));
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) mergeReturns(retVal,node.getExportType().apply(this, question));