Program: 61609
Project: 61609
Buggy source:
private GraphTargetItem traits(String scriptName,boolean scriptTraits,List<AssignableAVM2Item> sinitVariables,Reference<Boolean> sinitNeedsActivation,List<GraphTargetItem> staticInitializer,List<String> importedClasses,int privateNs,int protectedNs,int publicNs,int packageInternalNs,int protectedStaticNs,List<Integer> openedNamespaces,String pkg,String classNameStr,boolean isInterface,List<GraphTargetItem> traits) throws AVM2ParseException, IOException, CompilationException {
  ParsedSymbol s;
  GraphTargetItem constr=null;
  TypeItem thisType=pkg == null && classNameStr == null ? null : new TypeItem(pkg == null || "String_Node_Str".equals(pkg) ? classNameStr : pkg + "String_Node_Str" + classNameStr);
  List<AssignableAVM2Item> constrVariables=new ArrayList<>();
  List<Integer> originalOpenedNamespaces=openedNamespaces;
  int originalPrivateNs=privateNs;
  boolean inPkg=pkg != null;
  looptrait:   while (true) {
    s=lex();
    boolean isStatic=false;
    int namespace=-1;
    boolean isGetter=false;
    boolean isSetter=false;
    boolean isOverride=false;
    boolean isFinal=false;
    boolean isDynamic=false;
    String customAccess=null;
    if (scriptTraits && s.type == SymbolType.PACKAGE) {
      if (inPkg) {
        throw new AVM2ParseException("String_Node_Str",lexer.yyline());
      }
      openedNamespaces=new ArrayList<>();
      lexer.pushback(s);
      PackageAVM2Item p=parsePackage(openedNamespaces);
      pkg=p.packageName;
      inPkg=true;
      publicNs=p.publicNs;
      importedClasses=p.importedClasses;
      s=lex();
    }
    if (inPkg || classNameStr != null) {
      if (s.type == SymbolType.CURLY_OPEN) {
        staticInitializer.addAll(commands(thisType,pkg,sinitNeedsActivation,importedClasses,openedNamespaces,new Stack<Loop>(),new HashMap<Loop,String>(),new HashMap<String,Integer>(),true,false,0,sinitVariables));
        expectedType(SymbolType.CURLY_CLOSE);
        s=lex();
      }
      while (s.isType(SymbolType.STATIC,SymbolType.PUBLIC,SymbolType.PRIVATE,SymbolType.PROTECTED,SymbolType.OVERRIDE,SymbolType.FINAL,SymbolType.DYNAMIC,SymbolGroup.IDENTIFIER)) {
        if (s.type == SymbolType.FINAL) {
          if (isFinal) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isFinal=true;
        }
 else         if (s.type == SymbolType.DYNAMIC) {
          if (isDynamic) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isDynamic=true;
        }
 else         if (s.type == SymbolType.OVERRIDE) {
          if (isOverride) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isOverride=true;
        }
 else         if (s.type == SymbolType.STATIC) {
          if (isInterface) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          if (classNameStr == null) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          if (isStatic) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isStatic=true;
        }
 else         if (s.group == SymbolGroup.IDENTIFIER) {
          customAccess=s.value.toString();
          namespace=-2;
        }
 else {
          if (namespace != -1) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
        }
switch (s.type) {
case PUBLIC:
          namespace=publicNs;
        if (isInterface) {
          throw new AVM2ParseException("String_Node_Str",lexer.yyline());
        }
      break;
case PRIVATE:
    namespace=privateNs;
  if (isInterface) {
    throw new AVM2ParseException("String_Node_Str",lexer.yyline());
  }
break;
case PROTECTED:
namespace=protectedNs;
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
break;
}
s=lex();
}
}
 else {
namespace=privateNs;
}
if (namespace == -1) {
if (isInterface) {
namespace=abc.constants.getNamespaceId(new Namespace(Namespace.KIND_NAMESPACE,abc.constants.getStringId(pkg == null || pkg.isEmpty() ? classNameStr : pkg + "String_Node_Str" + classNameStr,true)),0,true);
}
 else {
namespace=packageInternalNs;
}
}
if (namespace == protectedNs && isStatic) {
namespace=protectedStaticNs;
}
switch (s.type) {
case CLASS:
List<Integer> subNamespaces=new ArrayList<>(openedNamespaces);
if (classNameStr != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isOverride) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String classTypeStr=s.value.toString();
GraphTargetItem extendsTypeStr=null;
s=lex();
if (s.type == SymbolType.EXTENDS) {
extendsTypeStr=type(thisType,pkg,new Reference<>(false),importedClasses,subNamespaces,new ArrayList<AssignableAVM2Item>());
s=lex();
}
List<GraphTargetItem> implementsTypeStrs=new ArrayList<>();
if (s.type == SymbolType.IMPLEMENTS) {
do {
GraphTargetItem implementsTypeStr=type(thisType,pkg,new Reference<>(false),importedClasses,subNamespaces,new ArrayList<AssignableAVM2Item>());
implementsTypeStrs.add(implementsTypeStr);
s=lex();
}
 while (s.type == SymbolType.COMMA);
}
expected(s,lexer.yyline(),SymbolType.CURLY_OPEN);
if (customAccess != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
traits.add((classTraits(scriptName,publicNs,pkg,importedClasses,isDynamic,isFinal,subNamespaces,pkg,namespace,false,classTypeStr,extendsTypeStr,implementsTypeStrs,new ArrayList<AssignableAVM2Item>())));
expectedType(SymbolType.CURLY_CLOSE);
break;
case INTERFACE:
if (classNameStr != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isOverride) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isFinal) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isDynamic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String intTypeStr=s.value.toString();
s=lex();
List<GraphTargetItem> intExtendsTypeStrs=new ArrayList<>();
if (s.type == SymbolType.EXTENDS) {
do {
GraphTargetItem intExtendsTypeStr=type(thisType,pkg,new Reference<>(false),importedClasses,openedNamespaces,new ArrayList<AssignableAVM2Item>());
intExtendsTypeStrs.add(intExtendsTypeStr);
s=lex();
}
 while (s.type == SymbolType.COMMA);
}
expected(s,lexer.yyline(),SymbolType.CURLY_OPEN);
if (customAccess != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
traits.add((classTraits(scriptName,publicNs,pkg,importedClasses,false,isFinal,openedNamespaces,pkg,namespace,true,intTypeStr,null,intExtendsTypeStrs,new ArrayList<AssignableAVM2Item>())));
expectedType(SymbolType.CURLY_CLOSE);
break;
case FUNCTION:
if (isDynamic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
if (s.type == SymbolType.GET) {
if (classNameStr == null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
isGetter=true;
s=lex();
}
 else if (s.type == SymbolType.SET) {
if (classNameStr == null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
isSetter=true;
s=lex();
}
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String fname=s.value.toString();
if (classNameStr != null && fname.equals(classNameStr)) {
if (isStatic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isStatic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isOverride) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isFinal) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
constr=(method(pkg,false,customAccess,new Reference<>(false),importedClasses,false,false,thisType,openedNamespaces,false,namespace,"String_Node_Str",true,constrVariables));
}
 else {
MethodAVM2Item ft=method(pkg,isInterface,customAccess,new Reference<>(false),importedClasses,isOverride,isFinal,thisType,openedNamespaces,isStatic,namespace,fname,true,new ArrayList<AssignableAVM2Item>());
if (isGetter) {
if (!ft.paramTypes.isEmpty()) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
}
if (isSetter) {
if (ft.paramTypes.size() != 1) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
}
if (isStatic && isInterface) {
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
}
GraphTargetItem t;
if (isGetter) {
GetterAVM2Item g=new GetterAVM2Item(ft.pkg,isInterface,customAccess,ft.needsActivation,ft.hasRest,ft.line,ft.isOverride(),ft.isFinal(),isStatic,ft.namespace,ft.functionName,ft.paramTypes,ft.paramNames,ft.paramValues,ft.body,ft.subvariables,ft.retType);
t=g;
}
 else if (isSetter) {
SetterAVM2Item st=new SetterAVM2Item(ft.pkg,isInterface,customAccess,ft.needsActivation,ft.hasRest,ft.line,ft.isOverride(),ft.isFinal(),isStatic,ft.namespace,ft.functionName,ft.paramTypes,ft.paramNames,ft.paramValues,ft.body,ft.subvariables,ft.retType);
t=st;
}
 else {
t=ft;
}
traits.add(t);
}
break;
case NAMESPACE:
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String nname=s.value.toString();
String nval="String_Node_Str";
s=lex();
if (s.type == SymbolType.ASSIGN) {
s=lex();
expected(s,lexer.yyline(),SymbolType.STRING);
nval=s.value.toString();
s=lex();
}
 else {
nval=(pkg == null || pkg.isEmpty() ? classNameStr : pkg + "String_Node_Str" + classNameStr) + "String_Node_Str" + nname;
}
if (s.type != SymbolType.SEMICOLON) {
lexer.pushback(s);
}
ConstAVM2Item ns=new ConstAVM2Item(pkg,customAccess,true,namespace,nname,new TypeItem("String_Node_Str"),new StringAVM2Item(null,nval),lexer.yyline());
traits.add(ns);
break;
case CONST:
case VAR:
boolean isConst=s.type == SymbolType.CONST;
if (isOverride) {
throw new AVM2ParseException("String_Node_Str" + (isConst ? "String_Node_Str" : "String_Node_Str"),lexer.yyline());
}
if (isFinal) {
throw new AVM2ParseException("String_Node_Str" + (isConst ? "String_Node_Str" : "String_Node_Str"),lexer.yyline());
}
if (isDynamic) {
throw new AVM2ParseException("String_Node_Str" + (isConst ? "String_Node_Str" : "String_Node_Str"),lexer.yyline());
}
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String vcname=s.value.toString();
s=lex();
GraphTargetItem type=null;
if (s.type == SymbolType.COLON) {
type=type(thisType,pkg,new Reference<>(false),importedClasses,openedNamespaces,new ArrayList<AssignableAVM2Item>());
s=lex();
}
 else {
type=TypeItem.UNBOUNDED;
}
GraphTargetItem value=null;
if (s.type == SymbolType.ASSIGN) {
value=expression(thisType,pkg,new Reference<>(false),importedClasses,openedNamespaces,new HashMap<String,Integer>(),false,false,true,isStatic || isConst ? sinitVariables : constrVariables);
s=lex();
}
GraphTargetItem tar;
if (isConst) {
tar=new ConstAVM2Item(pkg,customAccess,isStatic,namespace,vcname,type,value,lexer.yyline());
}
 else {
tar=new SlotAVM2Item(pkg,customAccess,isStatic,namespace,vcname,type,value,lexer.yyline());
}
traits.add(tar);
if (s.type != SymbolType.SEMICOLON) {
lexer.pushback(s);
}
break;
default :
if (s.type == SymbolType.CURLY_CLOSE && inPkg && classNameStr == null) {
inPkg=false;
pkg=null;
openedNamespaces=originalOpenedNamespaces;
privateNs=originalPrivateNs;
}
 else {
lexer.pushback(s);
break looptrait;
}
}
}
return constr;
}

Fixed version (ground truth):
private GraphTargetItem traits(String scriptName,boolean scriptTraits,List<AssignableAVM2Item> sinitVariables,Reference<Boolean> sinitNeedsActivation,List<GraphTargetItem> staticInitializer,List<String> importedClasses,int privateNs,int protectedNs,int publicNs,int packageInternalNs,int protectedStaticNs,List<Integer> openedNamespaces,String pkg,String classNameStr,boolean isInterface,List<GraphTargetItem> traits) throws AVM2ParseException, IOException, CompilationException {
  ParsedSymbol s;
  GraphTargetItem constr=null;
  TypeItem thisType=pkg == null && classNameStr == null ? null : new TypeItem(pkg == null || "String_Node_Str".equals(pkg) ? classNameStr : pkg + "String_Node_Str" + classNameStr);
  List<AssignableAVM2Item> constrVariables=new ArrayList<>();
  List<Integer> originalOpenedNamespaces=openedNamespaces;
  int originalPrivateNs=privateNs;
  boolean inPkg=pkg != null;
  looptrait:   while (true) {
    s=lex();
    boolean isStatic=false;
    int namespace=-1;
    boolean isGetter=false;
    boolean isSetter=false;
    boolean isOverride=false;
    boolean isFinal=false;
    boolean isDynamic=false;
    String customAccess=null;
    if (scriptTraits && s.type == SymbolType.PACKAGE) {
      if (inPkg) {
        throw new AVM2ParseException("String_Node_Str",lexer.yyline());
      }
      openedNamespaces=new ArrayList<>();
      lexer.pushback(s);
      PackageAVM2Item p=parsePackage(openedNamespaces);
      pkg=p.packageName;
      inPkg=true;
      publicNs=p.publicNs;
      importedClasses=p.importedClasses;
      s=lex();
    }
    if (inPkg || classNameStr != null) {
      if (s.type == SymbolType.CURLY_OPEN) {
        staticInitializer.addAll(commands(thisType,pkg,sinitNeedsActivation,importedClasses,openedNamespaces,new Stack<Loop>(),new HashMap<Loop,String>(),new HashMap<String,Integer>(),true,false,0,sinitVariables));
        expectedType(SymbolType.CURLY_CLOSE);
        s=lex();
      }
      while (s.isType(SymbolType.STATIC,SymbolType.PUBLIC,SymbolType.PRIVATE,SymbolType.PROTECTED,SymbolType.OVERRIDE,SymbolType.FINAL,SymbolType.DYNAMIC,SymbolGroup.IDENTIFIER)) {
        if (s.type == SymbolType.FINAL) {
          if (isFinal) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isFinal=true;
        }
 else         if (s.type == SymbolType.DYNAMIC) {
          if (isDynamic) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isDynamic=true;
        }
 else         if (s.type == SymbolType.OVERRIDE) {
          if (isOverride) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isOverride=true;
        }
 else         if (s.type == SymbolType.STATIC) {
          if (isInterface) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          if (classNameStr == null) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          if (isStatic) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
          isStatic=true;
        }
 else         if (s.type == SymbolType.NAMESPACE) {
          break;
        }
 else         if (s.type == SymbolType.NATIVE) {
          throw new AVM2ParseException("String_Node_Str",lexer.yyline());
        }
 else         if (s.group == SymbolGroup.IDENTIFIER) {
          customAccess=s.value.toString();
          namespace=-2;
        }
 else {
          if (namespace != -1) {
            throw new AVM2ParseException("String_Node_Str",lexer.yyline());
          }
        }
switch (s.type) {
case PUBLIC:
          namespace=publicNs;
        if (isInterface) {
          throw new AVM2ParseException("String_Node_Str",lexer.yyline());
        }
      break;
case PRIVATE:
    namespace=privateNs;
  if (isInterface) {
    throw new AVM2ParseException("String_Node_Str",lexer.yyline());
  }
break;
case PROTECTED:
namespace=protectedNs;
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
break;
}
s=lex();
}
}
 else {
namespace=privateNs;
}
if (namespace == -1) {
if (isInterface) {
namespace=abc.constants.getNamespaceId(new Namespace(Namespace.KIND_NAMESPACE,abc.constants.getStringId(pkg == null || pkg.isEmpty() ? classNameStr : pkg + "String_Node_Str" + classNameStr,true)),0,true);
}
 else {
namespace=packageInternalNs;
}
}
if (namespace == protectedNs && isStatic) {
namespace=protectedStaticNs;
}
switch (s.type) {
case CLASS:
List<Integer> subNamespaces=new ArrayList<>(openedNamespaces);
if (classNameStr != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isOverride) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String classTypeStr=s.value.toString();
GraphTargetItem extendsTypeStr=null;
s=lex();
if (s.type == SymbolType.EXTENDS) {
extendsTypeStr=type(thisType,pkg,new Reference<>(false),importedClasses,subNamespaces,new ArrayList<AssignableAVM2Item>());
s=lex();
}
List<GraphTargetItem> implementsTypeStrs=new ArrayList<>();
if (s.type == SymbolType.IMPLEMENTS) {
do {
GraphTargetItem implementsTypeStr=type(thisType,pkg,new Reference<>(false),importedClasses,subNamespaces,new ArrayList<AssignableAVM2Item>());
implementsTypeStrs.add(implementsTypeStr);
s=lex();
}
 while (s.type == SymbolType.COMMA);
}
expected(s,lexer.yyline(),SymbolType.CURLY_OPEN);
if (customAccess != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
traits.add((classTraits(scriptName,publicNs,pkg,importedClasses,isDynamic,isFinal,subNamespaces,pkg,namespace,false,classTypeStr,extendsTypeStr,implementsTypeStrs,new ArrayList<AssignableAVM2Item>())));
expectedType(SymbolType.CURLY_CLOSE);
break;
case INTERFACE:
if (classNameStr != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isOverride) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isFinal) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isDynamic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String intTypeStr=s.value.toString();
s=lex();
List<GraphTargetItem> intExtendsTypeStrs=new ArrayList<>();
if (s.type == SymbolType.EXTENDS) {
do {
GraphTargetItem intExtendsTypeStr=type(thisType,pkg,new Reference<>(false),importedClasses,openedNamespaces,new ArrayList<AssignableAVM2Item>());
intExtendsTypeStrs.add(intExtendsTypeStr);
s=lex();
}
 while (s.type == SymbolType.COMMA);
}
expected(s,lexer.yyline(),SymbolType.CURLY_OPEN);
if (customAccess != null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
traits.add((classTraits(scriptName,publicNs,pkg,importedClasses,false,isFinal,openedNamespaces,pkg,namespace,true,intTypeStr,null,intExtendsTypeStrs,new ArrayList<AssignableAVM2Item>())));
expectedType(SymbolType.CURLY_CLOSE);
break;
case FUNCTION:
if (isDynamic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
if (s.type == SymbolType.GET) {
if (classNameStr == null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
isGetter=true;
s=lex();
}
 else if (s.type == SymbolType.SET) {
if (classNameStr == null) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
isSetter=true;
s=lex();
}
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String fname=s.value.toString();
if (classNameStr != null && fname.equals(classNameStr)) {
if (isStatic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isStatic) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isOverride) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isFinal) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
constr=(method(pkg,false,customAccess,new Reference<>(false),importedClasses,false,false,thisType,openedNamespaces,false,namespace,"String_Node_Str",true,constrVariables));
}
 else {
MethodAVM2Item ft=method(pkg,isInterface,customAccess,new Reference<>(false),importedClasses,isOverride,isFinal,thisType,openedNamespaces,isStatic,namespace,fname,true,new ArrayList<AssignableAVM2Item>());
if (isGetter) {
if (!ft.paramTypes.isEmpty()) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
}
if (isSetter) {
if (ft.paramTypes.size() != 1) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
}
if (isStatic && isInterface) {
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
}
GraphTargetItem t;
if (isGetter) {
GetterAVM2Item g=new GetterAVM2Item(ft.pkg,isInterface,customAccess,ft.needsActivation,ft.hasRest,ft.line,ft.isOverride(),ft.isFinal(),isStatic,ft.namespace,ft.functionName,ft.paramTypes,ft.paramNames,ft.paramValues,ft.body,ft.subvariables,ft.retType);
t=g;
}
 else if (isSetter) {
SetterAVM2Item st=new SetterAVM2Item(ft.pkg,isInterface,customAccess,ft.needsActivation,ft.hasRest,ft.line,ft.isOverride(),ft.isFinal(),isStatic,ft.namespace,ft.functionName,ft.paramTypes,ft.paramNames,ft.paramValues,ft.body,ft.subvariables,ft.retType);
t=st;
}
 else {
t=ft;
}
traits.add(t);
}
break;
case NAMESPACE:
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String nname=s.value.toString();
String nval="String_Node_Str";
s=lex();
if (s.type == SymbolType.ASSIGN) {
s=lex();
expected(s,lexer.yyline(),SymbolType.STRING);
nval=s.value.toString();
s=lex();
}
 else {
nval=(pkg == null || pkg.isEmpty() ? classNameStr : pkg + "String_Node_Str" + classNameStr) + "String_Node_Str" + nname;
}
if (s.type != SymbolType.SEMICOLON) {
lexer.pushback(s);
}
ConstAVM2Item ns=new ConstAVM2Item(pkg,customAccess,true,namespace,nname,new TypeItem("String_Node_Str"),new StringAVM2Item(null,nval),lexer.yyline());
traits.add(ns);
break;
case CONST:
case VAR:
boolean isConst=s.type == SymbolType.CONST;
if (isOverride) {
throw new AVM2ParseException("String_Node_Str" + (isConst ? "String_Node_Str" : "String_Node_Str"),lexer.yyline());
}
if (isFinal) {
throw new AVM2ParseException("String_Node_Str" + (isConst ? "String_Node_Str" : "String_Node_Str"),lexer.yyline());
}
if (isDynamic) {
throw new AVM2ParseException("String_Node_Str" + (isConst ? "String_Node_Str" : "String_Node_Str"),lexer.yyline());
}
if (isInterface) {
throw new AVM2ParseException("String_Node_Str",lexer.yyline());
}
s=lex();
expected(s,lexer.yyline(),SymbolGroup.IDENTIFIER);
String vcname=s.value.toString();
s=lex();
GraphTargetItem type=null;
if (s.type == SymbolType.COLON) {
type=type(thisType,pkg,new Reference<>(false),importedClasses,openedNamespaces,new ArrayList<AssignableAVM2Item>());
s=lex();
}
 else {
type=TypeItem.UNBOUNDED;
}
GraphTargetItem value=null;
if (s.type == SymbolType.ASSIGN) {
value=expression(thisType,pkg,new Reference<>(false),importedClasses,openedNamespaces,new HashMap<String,Integer>(),false,false,true,isStatic || isConst ? sinitVariables : constrVariables);
s=lex();
}
GraphTargetItem tar;
if (isConst) {
tar=new ConstAVM2Item(pkg,customAccess,isStatic,namespace,vcname,type,value,lexer.yyline());
}
 else {
tar=new SlotAVM2Item(pkg,customAccess,isStatic,namespace,vcname,type,value,lexer.yyline());
}
traits.add(tar);
if (s.type != SymbolType.SEMICOLON) {
lexer.pushback(s);
}
break;
default :
if (s.type == SymbolType.CURLY_CLOSE && inPkg && classNameStr == null) {
inPkg=false;
pkg=null;
openedNamespaces=originalOpenedNamespaces;
privateNs=originalPrivateNs;
}
 else {
lexer.pushback(s);
break looptrait;
}
}
}
return constr;
}