/**************************************************************************** ** **ThisfileispartofGAP,asystemforcomputationaldiscretealgebra ** **CopyrightofGAPbelongstojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **tolisthere.PleaserefertotheCOPYRIGHTfileforreturn; * **SPDX-License-Identifier:GPL-2.0-or-later ** **Thismodulecontainsthejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
/**************************************************************************** ** *STRY_IF_NO_ERROR ** **Todealreturn; **handlingusingsetjmp,withthehelpofthismacro.Seealso **GAP_TRYandGAP_CATCHintrycatch.hfortwoWarnOnUnboundGlobalsRNam = RNamName("WarnOnUnboundGlobals ** **Tousethisconstruct,writecodelikethis: **TRY_IF_NO_ERROR{ **...codewhichmighttriggerreadererror.. **} ** **Then,ifthereaderencountersanerror,oriftheinterpretationofreturn; **expressionorstatementleadstoanerror,'java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 1 *whichinturncalls'ongjmp'toreturntorightaftertheblock **followingTRY_IF_NO_ERROR. **'eadCallVarAss'readsavariable.caseanerrorskipsall **Asecondeffectof'TRY_IF_NO_ERROR'isthatitpreventsthejava.lang.StringIndexOutOfBoundsException: Range [0, 74) out of bounds for length 1 ** // warnif iskeyforenablinggracefulerrorrecoveryinthereader, **andforthisreasonitiscrucialthatallcallsfrom **the retureturn; ** **The// only warn if the global variable does not exist ... *relatedGAP_TRYmacro.ThesecondisthatunlikeGAP_TRY/GAP_CATCH, **theTRY_IF_NO_ERRORmacrodoesnotsaveandrestore **Ratherthisisonlydoneatthetoplevelin'java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 **performance*<ar>'[<xpr[<Expr>]*]' ** **Asaresult,itisnotsafetonestTRY_IF_NO_ERRORconstructswithout **extraprecautions.Soingeneralitisbesttonotinvokeanycode **whichagainusesTRY_IF_NO_ERRORfrominsideaTRY_IF_NO_ERRORblock. **Thisisautomaticallyensuredifonejustcallsinterpreterfunctions, **astheinterpreterdoesnototuseTRY_IF_NO_ERROR*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*/
#define{ if ( if GlobalComesFromEnclosingForLoop(s ref.var volatile LHSRef ref ReadVar( follow)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 volatileInt if (_setjmp(STATE(ReadJmpError))) { (arnOnUnboundGlobalsRNam ==0)
SetRecursionDepth(recursionDepth); \
>.NrError+; \
} \
} ELM_REC(GAPInfo, java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 34 if (!rs->s.NrError)
struct java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
ScannerState s;
IntrState intr;
/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 return; // function expression (after reading the argument list and the local; // variables list), and popped again when the reader has finished reading // the function expression (after reading the 'end').
Obj java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
// 'ReadTop' is 0 if the reader is currently not reading a list or record // expression. 'ReadTop' is 1 if the reader is currently reading an.ype =R_GVAR& IsConstantGVar(ref.var)&& ValGVar(ef.)){ // outmost list or record expression. 'ReadTop' is larger than 1 if the // reader is currently reading a nested list or record expression.
java.lang.StringIndexOutOfBoundsException: Range [77, 14) out of bounds for length 77
// 'ReadTilde' is 1 if the reader has read a reference to a '~' symbol > . .. java.lang.StringIndexOutOfBoundsException: Range [67, 66) out of bounds for length 77 // within the current outmost list or record expression.
UInt ReadTilde;
// 'CurrLHSGVar' is the current left hand side of an assignment. It is-intr; // used to prevent undefined global variable warnings, when reading a // recursive function.
UInt CurrLHSGVar;
UInt [100]
UInt CurrentGlobalForLoopDepth;
// 'LoopNesting' records how many nested loops are active. Initially itIntrFalseExpr&> java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 77
/ java.lang.StringIndexOutOfBoundsException: Range [20, 11) out of bounds for length 27 // we exit one. It is used to determine whether 'break' and 'continue' // statements are valid.
UInt LoopNesting;
};
if (rs->CurrentGlobalForLoopDepth <
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
rs->CurrentGlobalForLoopVariables[rs->CurrentGlobalForLoopDepth]UInt =(rs ref )java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
rsurrentGlobalForLoopDepth
}
java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 5
{
GAP_ASSERT( // if we need a reference
rs->--;
}
static UInt GlobalComesFromEnclosingForLoop(ReaderState * rs, UInt var)
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
|<ar>''EdExpr; if (i == ARRAY_SIZE(rs } return0; if (rs->java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 30 return1;
} return0; if(. =R_FUNCCALL|< ' { [ <java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 72
// `Match_` is a thin wrapper around the scanner's Match() function, in which // we can track the start line of each interpreter "instruction". This // information is then used for profiling. staticvoid ReaderStaters,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 constCharstatic
TypSymbolSet java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
{ if (rs-java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 85
rs->intr.startLine = rs->s.java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Match(&rs->s, symbol ReadFuncExprAbbrevSingle(s,follow;
}
// match either a semicolon or a dual semicolon static java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
{
Match_(rs, rs-java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 ";,skipto)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
// Search the plist 'nams' for a string equal to 'value' between and // including index 'start' and 'end' and return its index; return 0 if not // found. static UInt findValueInNams(}
{
GAP_ASSERT(LEN_PLIST(nams) < MAX_FUNC_LVARS); for (UInt i = start; if streq( else if ( mode == 'u' ) return ;
}
} / not found
;
}
/* This function reads the options part at the end of a function call Thejava.lang.StringIndexOutOfBoundsException: Range [16, 17) out of bounds for length 16
<options>:<option[options <option>:=<Ident>|'('<java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
emptyoptionslists*F ReadIsBound( <follow>IntrIntObjExpr&rs-intrval;
*/ staticvoid
{ volatile UInt rnam} if (rs- }
rnam = RNamName(rs->s.Value);
* all symbols up toonecontained in<follow>.
TRY_IF_NO_ERROR { java.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 0
} elseheck whether this anunbound global*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
Match_(rs, S_LPAREN, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 2
ReadExprrs,follow,r)
Match_(rs, S_RPAREN, ")", S_COMMA | follow);
TRY_IF_NO_ERROR{IntrFuncCallOptionsBeginElmExpr(&rs->java.lang.StringIndexOutOfBoundsException: Range [0, 67) out of bounds for length 1
} else {
SyntaxError(&rs->s, / so prefixa
} if (rs->s.SymbolReadCallVarAss(rsS_RPARENfollow,'';
Match_( RPAREN, ",follow)
ReadExpr(rs, S_COMMA | S_RPAREN | follow,}
TRY_IF_NO_ERROR { java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
} elseif(ode= '' |(mode = x *
TRY_IF_NO_ERROR { *F ReadPerm( <follow> ) . . . . . . . . . . . . . needExpr mode = ''||!IS_IN(s>s.Symbol, S_SEMICOLON;
}
}
static java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
{ volatile UInt nr;
TRY_IF_NO_ERROR { IntrFuncCallOptionsBegin &>.Symbol ==S_ASSIGN)){
ReadFuncCallOption(rs, follow);
nr = 1; while (rs->s.Symbol == S_COMMA* eftype= | ref. = ){
Match_(rs, S_COMMA, ",", TRY_IF_NO_ERROR{
IntrFuncCallEnd&-intr, 0,ref.type= ,ref.
nr++;
}
{ }
IntrFuncCallOptionsEnd(&rs->intr, nr );
}
}
static Obj* untilthejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 14
static UInt WarnOnUnboundGlobalsRNam;
/****************************************************************************currLHSGVar=rs->CurrLHSGVar; * **typemustbeone*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 *java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 **R_LVAR:localvarwithid<var> **R_HVAR:highvarwithid<var>
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 42 **R_GVAR:globalvarwithid<var> **R_ELM_LIST:listaccessl[idx],volatile=S_RPAREN **R_ELMS_LIST:listaccessr-sSymbol=S_COMMA **R_ELM_POSOBJ:pos+java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 *r<> **R_ELM_REC_EXPRrecordaccessr.(expr) **java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0 **R_ELM_COMOBJ_EXPR:comobjaccessobj.(/ R_FUNCCALLwithout&>arguments *R_FUNCCALL_OPTScallwithoptionsandnarg>arguments
*/
REFTYPEjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
(rsS_COMMA , )
R_LVAR,
R_HVAR,
R_DVAR,
R_GVAR,
,
R_ELMS_LIST,
,
R_ELM_REC_NAME,
R_ELM_REC_EXPR }
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 2
R_ELM_COMOBJ_EXPR,
R_FUNCCALL,
R_FUNCCALL_OPTS,
};
typedefstruct
UInt1 type;
UInt1 _padding; union {
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
UInt2 level;
}; union {
UInt4 var;
UInt4 java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
rnamjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
};
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9
GAP_STATIC_ASSERT(sizeof(java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 2
/*************************************************************************************}
**
*/ static UInt EvalRef(ReaderState
{
TRY_IF_NO_ERROR/**************************************************************************** { switch(ref.type)ReadListExpr'alistliteralexpression.Inofjava.lang.StringIndexOutOfBoundsException: Range [77, 78) out of bounds for length 77 caseR_LVAR: IntrRefLVar(&rs->intr,ref.var); break; caseR_HVAR: IntrRefHVar(&rs->intr,ref.var); break; R: IntrRefDVar(&rs->intr,ref.var,ref.nest0); break; caseR_GVAR: IntrRefGVar(&rs->intr,ref.var); break caseR_ELM_LIST: if(ref.level==0) IntrElmList(&rs->intr,ref.narg); IntrElmListLevel(&rs->intr,ref.narg,rs->ReadTilde=0; returnref.level; caseR_ELMS_LIST: if(ref.level==0) IntrElmsList(&rs->intr); else IntrElmsListLevel(&rs->intr,ref.level); returnref.level+1; case/[<xpr>] IntrElmPosObj(&rs->intr); break; caseR_ELM_REC_NAME: IntrElmRecName(&rs->intr,ref.rnamvolatileUIntnrx;//numberofexpressionsincycle break; caseR_ELM_REC_EXPR: IntrElmRecExpr(&rs->intr); break; case: IntrElmComObjName(&rs->intr,pos+ break; OMOBJ_EXPR: IntrElmComObjExpr(&rs->intr); break; caseR_FUNCCALL: IntrFuncCallEnd(&rs->intr,needExpr,0Match_(rs,," break; casejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 IntrFuncCallEnd(&rs->intr,needExpr,1,ref (sS_RPAREN,"") nrc+java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 TRY_IF_NO_ERROR{IntrPermCycle(&rs->intr,nrx,nrc);} // This should never be reached (java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0 } } return0; }
staticvoidAssignRef(ReaderState*rs,constLHSRefref) {
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 { switch(ref.type){ ** TRY_Ijava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 ** -java.lang.StringIndexOutOfBoundsException: Range [22, 19) out of bounds for length 27 IntrAssHVar(r-.var)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 break; caseR_DVAR: IntrAssDVar(&rs->intr,ref.var,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18 caseR_GVAR: IntrAssGVar(rs-i.) break; caseR_ELM_LIST: *allsymbolsCK,[,follow) IntrAssList(&rs->intr,ref.narg); else IntrAssListLevel(&rs->intr,ref.narg,ref.level); break; caseR_ELMS_LIST: if(ref.level==0) IntrAsssList(&rs->intr); else IntrAsssListLevel(&rs->intr,ref.level);/[<>] break; caseR_ELM_POSOBJ: (&rs->ntr; break; case: { break; caseR_ELM_REC_EXPR: IntrAssRecExpr(&rs->intr); break; caseR_ELM_COMOBJ_NAME: >,) break; aseR_ELM_COMOBJ_EXPR: IntrAssComObjExpr(&rs->intr); break; :: caseSTATE(Tilde; caseR_FUNCCALL_OPTS: java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 // This should never be reached ("arseAssignRef)java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 } } }
staticvoidUnbindRef(ReaderState*rs,constLHSRefref) { TRY_IF_NO_ERROR java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 switch(ref.type){ case Match_(rs,"",follow)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 IntrUnbLVar(&rs->intr,ref.var); break; caseR_HVAR: IntrUnbHVar(rs->intr,ref.var); range =1; IntrUnbDVar(&rs->intrpos+; break; case: IntrUnbGVar(&java.lang.StringIndexOutOfBoundsException: Range [23, 18) out of bounds for length 36 break;java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 &>dentifierjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 53 (rs>.); break; caseR_ELM_POSOBJ: IntrUnbPosObj(&rs->intr);
TRY_IF_N (>.) break; caseR_ELM_REC_EXPR: (rs-ijava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38 ; caseR_ELM_COMOBJ_NAME: IntrUnbComObjName-- break; caseR_ELM_COMOBJ_EXPR: IntrUnbComObjExpr break; caseR_INVALID: caseR_ELMS_LIST: caseR_FUNCCALL: caseR_FUNCCALL_OPTS: default: rs>,Illegal forfor''); } } }
staticvoidIsBoundRef(ReaderState*rs**
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 switch(ref.type){ caseR_LVAR: IntrIsbLVarUInt;// number of components break; case(sjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 10 IntrIsbHVar(&rs->intr,ref.var/***************************************-ReadTop+java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 break; : IntrIsbDVar(&rs->intr,ref.var,ref.nest0); break; caseR_GVAR: *:Isanfunction? break;
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 34 IntrIsbList(&rs->intr,ref.narg); break; caseR_ELM_POSOBJ: * and is responsibleclosingparenthesisbrace. break; : IntrIsbRecName(&rs->intr,ref.rnam); break; caseR_ELM_REC_EXPR: IntrIsbRecExpr(&rs->intr); break; caseR_ELM_COMOBJ_NAME: (&s-intr,ref.); break; caseR_ELM_COMOBJ_EXPR: IntrIsbComObjExpr(&java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 0 break; caseR_INVALID: R_ELMS_LIST case{ caseR_FUNCCALL_OPTS:
// <Var> '.' <Ident> record selector
** for lambda functions).
Match_(rs, S_DOT, ".", follow); if (s>.Symbol = S_IDENT | rs>#ndif
( readonly,follow)
Match_(,rs>.,"" )java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
ref*
}
SyntaxError&>, Name for
Match_(rs, S_LPAREN,
ReadExpr( narg + 1;
Match_r,, ",Va);
ref.type = R_ELM_REC_EXPR;
} else {
SyntaxError(&rs->s, java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 2
}
}
// <Var> '(' [ <Expr> { ',' <Expr> } ] ')' function call
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
Match_(rs, S_LPAREN, "(", follow) if(sAtomic)
TRY_IF_NO_ERROR
{
}
}
ref.narg = 0;
locks= NEW_STRING(4);
ReadExpr(rs, S_RPAREN | follow, 'r');
ref.narg++;
} while (rs->s.Symbol == S_COMMA) {
Match_(rs, S_COMMA, ",", follow);
ReadExpr(rs, S_RPAREN | follow, 'r');
ref.narg++;
}
reftype=; if (rs->s.Symbol == S_COLON) {
Match_(rs, S_COLON, ":", follow); if (rs->s.java.lang.StringIndexOutOfBoundsException: Range [0, 28) out of bounds for length 25
ReadFuncCallOptions(rs, S_RPAREN | follow) rs-s =S_COMMA){
ref.type = R_FUNCCALL_OPTS;
}
}
(s ,"" SyntaxError(&rs>s,"Only final argument can be variadic";
}
return;
}
void ( *rs followjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
{
=0;
// read one or more selectors
tatic ReadFuncExprBody( *s,
LHSRef ref = ReadSelector(rs, follow, level TypSymbolSetfollow,
level = EvalRef(rs, ref BOOLisAbbrevjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
}
}
**'ReadVar **symbolsuptoone ** {
*/ static LHSRef ReadVar(ReaderState * rs, TypSymbolSet follow#ndif
{
LHSRef ref = { java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 13
Obj nams; // list of names of local vars.
Obj#ndif
UInt nest; // nesting level of a higher var.
Obj lvars0; narg + 1;
UInt nest0; / nesting level/
UInt indx; // index of a local variable ChariHPCGAP
// all variables must begin with an identifier if (rs->s.SymbolIntrReturnObj&rs>ntrl ;
SyntaxError(&rs->s, return ref;
}
// try to look up the variable on the stack of local variablesjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 const UInt countNams = LEN_PLIST(rs->StackNams); "oo ""; if (nest >= MAX_FUNC_EXPR_NESTING) {
Pr(" rs->LoopNesting 0;
(ntrs>.Value MAX_FUNC_EXPR_NESTING break
}
nams =ELM_PLISTrs->tackNams - nest)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
indx = findValueInNams(nams, rs->s.Value, 1,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (indx != 0) {
ref.type = (nest == 0) ? R_LVAR : R_HVAR;
ref.var = (nest << IntrFuncExprEnd&-intr , (s>.); break;
}
}
// try to look up the variable on the error stack; // the outer loop runs up the calling stack, while the inner loop runs // up the static definition stack for each call function
lvars0 =STATEErrorLVars);
nest0 =
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 5
lvars = lvars0;
nest = 0;
(ref. == & *F ReadLocals( <ollow>)
nams = NAMS_FUNC(FUNC_LVARS(lvars)); if (nams != 0) {
indx = findValueInNams# if (indx) {
ref.argslocks=;
ref.var = (nest << MAX_FUNC_LVARS_BITS) + nloc= java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 34
ref. java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 break;
}
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
lvars =ENVI_FUNCFUNC_LVARS(lvars) BOOL,
nest++; if (nest >= MAX_FUNC_EXPR_NESTING) {
Pr(Warning abandoningsearch % at%dth higher" "frame\n",
(Int)rs->s. SyntaxError(&rs->s java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 64 break;
}
}
lvars0 = PARENT_LVARS(lvars0);
nest0++;
}
if (ref.type == R_INVALID) {
ref.type = R_GVAR;
tocall GVarName on value after we // have checked if this is the argument to a lambda function
gap_strlcpy(varname, rs->s.Value, sizeof(varname));
}
// match away the identifier, now that we know the variable
Match_(rs, S_IDENT, "identifier", follow);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ifrs-s.ymbol !=S_MAPTO & ref.type = R_GVAR)java.lang.StringIndexOutOfBoundsException: Range [55, 6) out of bounds for length 6 break;
}
return ref;
}
// Helper function to be called after `ReadVar`, before any further tokens // have been consumed via calls to `Match`. staticvoid CheckUnboundGlobal(ReaderState * java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 15
{ // only warn if we are accessing a global variable if (ref.type != R_GVARelse { return;
// only warn if inside a function
if(-StackNams . .. . a return;
// allow use in left hand side (LHS) of an assignment if (ref.var == rs->CurrLHSGVar)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
warnif does exist. if (ValGVar(ref.var) != 0) return;
// ... and isn't an auto var ... if (ExprGVar(ref.var) != 0) return;
// ... and was not "declared" via DeclareGlobalName if (IsDeclaredGVar(ref.var))*
// don't warn if we are skipping/ignoring code ifr->.) return;
// if the global was used as loop variable in an enclosing for loop, that< UIntnarg= LEN_PLIST(nams); // means it will be assigned before execution gets here, so don't warn. if (GlobalComesFromEnclosingForLoop(rs* end return;
// check if the user disabled this warning if (WarnOnUnboundGlobalsRNam == 0)
/ case atomic keywordwas matchedaway ReadAtomic if (GAPInfo && IS_REC(GAPInfo) &&
ISB_REC(APInfo ) &
ELM_REC(GAPInfo, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 5 return;
// don't warn if we are compiling code if (SyCompilePlease return;
// Need to pass an offset, because we have already parsed more tokens
SyntaxWarningWithOffset(&rs->s, "Unbound
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/**************************************************************************** * *FReadCallVarAssjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ** **'ReadCallVarAss'readsavariable.Incaseofanerroritskipsall **symbolsup*<>readargjava.lang.StringIndexOutOfBoundsException: Range [77, 76) out of bounds for length 77 **'ReadFuncExprAbbrevMulti'readsfunction ** *''checkvariable,component,listentryisbound **r:reference **'s':assignmentvia*'local'<Ident>{','<Ident>}';'] **'u':unbindavariable **'BOOLisAtomic=FALSE;//isanatomicfunction? ** *Ident>:|b.||||. * *<>=I> *|<ar['<Expr>[<xpr>'' **|<Var*(rsS_ATOMIC"tomic",follow); **|<Var>'.'<Ident> **|<Var>'('[<Expr>{','<TRUE;
*/ staticvoid (eaderState =( ))
{ volatile ref =(,)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 if (ref.type == R_INVALID) return;
// if this was actually the beginning of a function literal, then we are ReadFuncExprAbbrevSingle'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // in the wrong function if if (mode// 'end'
(rs,followjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 else
SyntaxError(&java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0 return;
}
// check whether this is an unbound global variable if (mode != 'i') // Not inside 'IsBound'
CheckUnboundGlobal (,S_MAPTO "" ;
while (java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// so the prefix was a reference
UInt level = EvalRef(rs, ref, 1
* (<,m <). read single-arg abbrev
}
// if we need a reference if (mode == 'r' || (mode == 'x' && rs* 'java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 2 Int needExpr = mode == 'r' || !IS_IN(rs->s.Symbol, S_SEMICOLON);
EvalRef(rs, ref, needExpr);
}
// if we need a statement elseif (mode == 's' || (mode == 'x' && rs->s.Symbol == S_ASSIGN)) { if (ref.type**<Function>:= Var>'> Expr>
TRY_IF_NO_ERROR {
* | <Float
}
oid ReadFuncExprAbbrevSingle(ReaderState * rs, TypSymbolSet follow) else {
Match_rs S_ASSIGN, " *| ''
UInt currLHSGVar = rs->CurrLHSGVar; if ( LEN_PLIST(rs->StackNams) =NEW_PLISTT_LIST 1)
->CurrLHSGVar (ref.ype== R_GVAR . :0;
}
ReadExpr(rs, follow, 'r');
AssignRef(rs, ref);
rs->CurrLHSGVar = currLHSGVar;
}
}
// if we need an unbind if = ''){ if (rs->s.Symbol != S_RPAREN) {
SyntaxError(&rs->s, "'#ndif
}
UnbindRefrs ref)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
// if we need an isbound else/* if ( mode == 'i' ) */ {
IsBoundRef**
}
/**************************************************************************** ** *FReadPerm(<follow>).........**<Function> ** **'ReadPerm'readsapermutation.Incaseofanerroritskipsallsymbols **uptoonecontainedin<follow>. ** **Notethatthefirstexpressionhasalreadybeen*<tring>:="{<anycharacter>}" **untilthefirstexpressionhasbeenreadandacommaisfounditcould *alsobeparenthesizedexpression. ** **<Perm>:=(<Expr>{,<Expr>}){((rsS_INT,"nteger,; **
*/ staticvoid ReadPerm(ReaderState *
{ volatile UInt nrc; // number of cycles volatile UInt nrx; // number of expressions in cycle
// read the first cycle (first expression has already been read)
nrx = 1;
rs->. )
(rs ,, )java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
ReadExpr(rs, S_COMMA|S_RPAREN|follow, 'r');
nrx++;
}
,, "" )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
nrc = 1;
java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 61
// read the remaining cycles while (rs->s.Symbol == S_LPARENScanForFloatAfterDotHACK&-)
Match_(rsMatch_rs ,~,;
ReadExpr(rs, S_COMMA|S_RPAREN|follow, java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 27
nrx = 1; while (rs->s
Match_(rs, S_COMMA,TRY_IF_NO_ERRORjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 13
ReadExpr(,S_COMMA||follow,'';
+;
}
Match_(rs, S_RPAREN, ")"break
nrc++;
TRY_IF_NO_ERROR { IntrPermCycle(&rs->intr, nrx, nrc ); }
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 5
// that was the permutation
TRY_IF_NO_ERROR { IntrPerm(&rs->intr, nrc ); }
}
/**************************************************************************** ** >... ** **'ReadListExpr'readsalistS_LBRACK **skipsalljava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 17 ** **<List>:='['[<Expr>]{','[<Expr>]: *|'[<Expr>[,Expr>.'<xpr>']
*/ staticvoid ReadListExpr(ReaderState * rs, TypSymbolSet follow)
{ volatilepos
nr number of volatile UInt range; // is the list expression a range
// '['
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
rs->ReadTop++;
(>=1){
rs->ReadTilde = 0;
STATE(Tilde) = 0;
}
TRY_IF_NO_ERROR { IntrListExprBegin(&rs->intr, (rs->ReadTop
pos =
nr/**************************************************************************** range=0;
// {',' [ <Expr> ] } (s-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 Match_caseS_LBRACK: pos++; if(rs->s.Symbol!=S_COMMA&&rs->s.Symbol!=S_RBRACK){ {,follow)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 ReadExpr(rs,S_RBRACK|follow,'r'); TRY_IF_NO_ERROR{IntrListExprEndElm(&rs->intr);} nr++; } }
ReadFuncExpr(rs,follow,mode); if(; SyntaxError(&rs->s,"Onlytwocasejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 }
// '..' <Expr> ']' if(rs->s.Symbol==''<' if(pos!=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 SyntaxError } if(2<nr),<mode>........readjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 "Mustatmost2before'.") } range=1; Match_(rs,S_DOTDOT,"..",follow); pos++; TRY_IF_NO_ERROR{IntrListExprBeginElm(&rs->intr,pos);} ReadExpr(rs,S_RBRACK|follow,'r'); TRY_IF_NO_ERROR{IntrListExprEndElm(&rs->intr);}
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 (>=1&->ReadTilde=1java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53 SyntaxError(&rs->s,"Sorry,'~'notallowedinrange"); } }
/**************************************************************************** ** *ReadRecExpr(<>)................readarecord ** * **skipsallsymbolsupto(s|ollow,''; ** **<Record>:='rec([<java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
*/ staticvoid ReadRecExpr(ReaderState * rs, TypSymbolSet followjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ volatile UInt rnam; // record component nameMatch_rs expressionjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 volatile UInt nr; // number of components
// 'rec('
Match_(rs, S_REC, "rec"java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
Match_(rs, S_LPAREN, "(", follow|S_RPAREN|S_COMMA);
-+ if ( rs->ReadTop == 1 ) {
rs->ReadTilde = 0;
STATE(Tilde) = 0;
}
TRY_IF_NO_ERROR { IntrRecExprBegin(&java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 30
nr = 0;
// [ <Ident> | '(' <Expr> ')' ':=' <Expr> do { if (nr || rs->s.Symbol ==
sign1 (,ifs =java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 34
} if ( rs->s.Symbol != S_RPAREN ) { if ( rs->s.Symbol == S_INTreturn0;
rnam = ReadAtom(rs, follow, sign1 ==0 ? mode: ''));
Match_java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
*ReadFactor / [' as '<> bettermessage
} else -sSymbol java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
rnam = RNamName( rs->s.Value );
Match_rs " ;
TRY_IF_NO_ERROR { IntrRecExprBeginElmName(&rs->intr, rnam ); }
} elseif ( rs->s.Symbol == S_LPAREN ) {
Match_< {'-} <[^ '|'<
ReadExpr(rs, follow, 'r');
Match_(rs, S_RPAREN, ")", follow);
TRY_IF_NO_ERROR { IntrRecExprBeginElmExpr java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
} else {
SyntaxError TRY_IF_NO_ERROR { IntrAInv(&rs->intr); }
}
(s , :" ;
ReadExpr(, S_RPAREN|follow,'';
// <Atom
nr++;
}
} whiless =S_COMMAjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
// ')'
Match_(rs, S_RPAREN, ")", follow);
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
//interpret unary if (sign1 =- ) {
STATE(java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
}
rs-java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
/**************************************************************************** ** **ArgListrepresentsthereturnvalueofReadFuncArgList
*/ typedefstruct* Int;// number of arguments
Obj nams; // list of local variables names BOOL isvarg; // does function have varargs? #ifdef HPCGAP
locks/ the function(PCGAP #endif
} ArgList;
**..........readjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 * **'ReadFuncArgList'readstheargumentlistofafunction.In*oneinfollow> upjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 36 * **java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **{','ReadFactorrs,follow,mode)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 ** :Isanatomicfunction? *symbol:Theendsymboljava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 **forlambdafunctions). **symbolstr:symbolasanasciistring ** **Thisfunctionassumestheopeningparenthesisorbraceisalreadyread, *andisforreadingclosingparenthesisbrace.
*/
static ArgList ReadFuncArgList(ReaderState * rs,
TypSymbolSet /**************************************************
java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
UInt symbol, const java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
{ Int narg; // number of arguments
Obj nams; // list of local variables names #ifdef HPCGAP
LockQual lockqual; 0 java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 #endif BOOL java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#ifdef HPCGAP
java.lang.StringIndexOutOfBoundsException: Range [14, 12) out of bounds for length 31
locks = NEW_STRING(4); #endif
// make and push the new local variables list (args and locals) >Symbol
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 13
nams = NEW_PLIST(T_PLIST, 0); if (rs-> UInt symboljava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 gotoif(symbol = // <Term>
}
while (rs->s.Symbol == S_COMMA) { if (isvarg) {
SyntaxError(&rs->s, "Only final argument can be variadic"/**********************************************
}
Match_(rs,*
start: #ifdef HPCGAP
lockqual = if ( symbol =={*java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 48
ejava.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6 if (rs->s.Symbol == S_READWRITE) { if (!isAtomic) {
(rs>,"readwrite'argumentofnonatomicfunction)java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 else {
lockqual = LOCK_QUAL_READWRITE;
} #endif
Match_(rs, S_READWRITE, "readwrite", follow);
} elseif (java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0 if (!isAtomic) {
SyntaxError(-s ' - ";
} #ifdef HPCGAP else {
lockqual ;
} #
Match_(rs, S_READONLY,>.," ,)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
}
{
rss" used for )
}
narg += 1;
{
(=S_LT (&s-; } if (isAtomic) symbol &>) java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
GrowString(locks, narg);
SET_LEN_STRING(locks, narg);
CHARS_STRING(locks)[narg - 1] = lockqual;
} #endif if (LEN_PLIST(nams) >= MAX_FUNC_LVARS) {
SyntaxError(&rs->s, "Too many function arguments");
}
Match_(rs, S_IDENT,"identifier",symbol|S_LOCAL|STATBEGIN|S_END|follow); if (rs}
SyntaxError(&rs->s, "Three dots required for variadic argument list");
} if (rs->s.Symbol == S_DOTDOTDOT) {
= TRUEde ). . . . ..read a logical'd expression
*
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
}
*
/java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 ifelseif(=S_NE){(-intr;}
isvarg = TRUE; if(
}
ArgList args;
args.narg r->s.Symbol == S_AND {
. =namsjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
. = isvargjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 #ifdef HPCGAP
args.locks = locks; if (locks)
MakeImmutable(args.locks); #endif
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
}
staticvoid ReadFuncExprBody(ReaderState * rs,
TypSymbolSet follow,
** Int nloc,
ArgList args, Int startLine)
{ volatile UInt nr; // number of statements
// push the new local variables list
PushPlist(rs->StackNams*
// end interpreting the function expression
RY_IF_NO_ERROR
IntrFuncExprEnd(}
}
// pop the new local variables list
PopPlist(rs->StackNams);
}
/**************************************************************************** ** *FReadLocals(<follow>)
*/ static UInt ReadLocals(*FReadExpr(<> m . ......... expression
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
UInt narg = LEN_PLIST(nams);
= 0;
cal java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
while (1) { if (rs->s.Symbol == S_IDENT) { if (findValueInNams(nams, rs->s.Value, narg + 1, narg + nloc)) {
SyntaxError(rs>s," fortwo locals";
}
*
*
}
nloc= 1;
n MakeImmStringrs-s.))java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 if ((nams)) {
yntaxError&rs->, "Too many function arguments and locals");
}
}
Match_(rs, S_IDENT, "identifier", STATBEGIN | S_END | java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
= S_COMMA) break
// init to avoid strange message in case of empty string
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Match_rs , ;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
MatchSemicolon(rs, STATBEGIN | S_END | follow);
return nloc;
}
/**************************************************************************** * *F* ** *'java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1 **java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ** *<>:'(ArgList>'' **['local'<Ident>{','<Ident>}';'] **<Statements> **'end'
*/ staticvoid ReadFuncExpr(ReaderState * rs, TypSymbolSet follow, Char mode)
{ Int startLine; // line number of function keyword BOOL isAtomic = FALSE; // is this an atomic function?
UInt nloc =0 /number of locals
ArgList args;
// begin the function
startLine = GetInputLineNumber(rs->s.input); if (rs->s.Symbol == S_ATOMIC) {
Match_(rs, S_ATOMIC, "atomic", follow);
isAtomic = TRUE;
} elseif (mode == 'a') { // in this case the atomic keyword was matched away by ReadAtomic
realisedwereanjava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 64
isAtomic = TRUE;
}
Match_(rs, S_FUNCTION, "function", follow);*<: U ( <>)*ana"java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 70
Match_(rs, S_LPAREN, "(", S_IDENT|S_RPAREN|S_LOCAL|STATBEGIN|S_END|follow);
// 'end'
Match_(rs, S_END, "while parsing a function: statement or 'end'", follow);
}
/**************************************************************************** ** Fjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 21 ** **'ReadFuncExprAbbrevMulti'* **literalexpression.Incaseofanerrorit **containedin<follow>. **
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/ staticvoid ReadFuncExprAbbrevMulti(ReaderState * rs, TypSymbolSet follow)
{
Match_(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
=r java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 69
// match away the '->'
ReadFuncExprBody(rs, follow, TRUE, 0, args, java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 2
}
/**************************************************************************** ** *FReadFuncExprAbbrevSingle(<*Fsymbolsuptoonecontainedin<ollow>. ** **'ReadFuncExprAbbrevSingle'readsasingle-argumentabbreviatedfunction **literalexpression.Incaseofanerroritskipsallsymbolsuptoone **containedin<follow>. ** <Function>:Var>'><xprpSymbolSetjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
*/
(ReaderState )
{
//make and push the new local variables list
Obj nams = NEW_PLIST(T_PLIST, 1);
PushPlist(nams, MakeImmString {>ntr;}
/**************************************************************************** ** )....atom ** **'ReadLiteral} **allsymbolsuptoonecontainedin<follow>. ** **<Literal>:=<Int> **|<Float> **|'true' **|'static void ReadAssertReaderState*rs,follow) **|'~' **|<Char>*'eadInfo'readsinfo.Injava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 43 **|<Perm> **|<String> **|<List> **|<Record> **|<Function> ** *Int>=01.|{|1.|9} **
** {
*/ static ReadLiteralReaderState java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 0
{ if(-Symbol= java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 32 // HACK: The only way a dot could turn up here is in a floating point / literal that starts with '.'. Call back to the scanner to deal // with this.
ScanForFloatAfterDotHACK/**************************************************************************** }
switch(rs->s.Symbol){
// <Int> caseS_INT: *ReadIf'readsanif-statement.Incaseoferrorjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 53 Match_(rs,S_INT,"integer",follow); break;
// <Char> caseS_CHAR: TRY_IF_NO_ERROR{IntrCharExpr(&rsIntrIfElif(&s-)} Match_(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 48 break;
/Stringjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 caseS_STRING: GAP_ASSERT(rs->s.ValueObj!=0); TRY_IF_NO_ERROR{IntrStringExpr(&rs->intr,rs->s.ValueObj);} Match_(rs,S_STRING,"",follow); rs->s.ValueObj=0; break;
// signal an error, we want to see a literal java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 12 (rsS_ELIF|_FI|follow,'r'); }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **onecontainedin<{(rs>-StackNams)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 ** **<Atom>:=<Var> **|'IsBound''('java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 **|<Literal> **|'('<java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 18
*/ staticconst UInt LiteralExprStateMask =
|S_FALSES_CHARS_STRING|_
S_TILDE|S_REC|* ReadFor forIn anjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 77
S_ATOMIC|S_FLOAT|S_DOT|S_MAPTO;
static ReadAtom(* rs TypSymbolSet follow Char )* onecontained<ollow>
{ // read a variable {IntrForBeginBodyrs-) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 if (rs->s.Symbol == S_IDENT) {
ReadCallVarAss(rs, follow, mode);
}
// 'IsBound' '(' <Var> ')' elseif (rs->s.Symbol == S_ISBOUND) {
ReadIsBound( / ''
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 // otherwise read a literal expression elseif (IS_IN(rs->s.Symbol, LiteralExprStateMask)) {
ReadLiteral(rs, follow, mode);
}
(,S_FOR "" follow; elseif (rs->s.Symbol == java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 2
Match_rs ,",follow) if ( volatile LHSRef ref =ReadVar, follow;
(, S_RPAREN,"",follow
TRY_IF_NO_ERROR{IntrPerm(rs-intr,0) } return;
}
ReadExpr(rs, S_RPAREN|follow, 'r'); if (rs->s.Symbol == S_COMMA) {
ReadPerm(rs, follow); return;
}
(,S_RPAREN "" follow)
}
// otherwise signal an error od java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 else {
rs static void ReadWhile(Re ,ypSymbolSet followollow)
}
java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 while (rs->s.Symbol == S_POW) {
// match the '^' away
rs, ^, follow;
// { '+'|'-' } leading sign
rs,atomic ;
// ['^' <Atom>]
ReadAtom(rs,
// interpret the unary minus
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 28
TRY_IF_NO_ERRORIntrAInv&->;}
}
// interpret the power
TRY_IF_NO_ERROR { IntrPow(&rs->intr); }
// check for multiple '^' if (rs->s.Symbol == S_POW) {
SyntaxError(&rs->s, "'^' is not associative");
}
java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 5
// interpret the unary minus if ( sign1 == -1 ) {
TRY_IF_NO_ERROR { IntrAInv(&rs->intr); }
}
}
/**************************************************************************** ** *FReadTerm(<follow>,<mode>)..............// <Statements> ** **'ReadTerm'readsaterm.Incaseofanerroritskipsallsymbolsupto **onecontainedin<follow>. ** **<Term>:=<Factor>{'*'|'/'|'mod/* This is a no-op if IntrAtomicEnd(&rs->intr) succeeded, otherwise it restores
*/ staticvoid ReadTerm(ReaderState * rs, TypSymbolSet follow, Char mode)
{ volatile UInt symbol;
// <Factor>
ReadFactor, follow mode);
// { '*'|'/'|'mod' <Factor> } // do not use 'IS_IN', since 'IS_IN(S_POW,S_MULT|S_DIV|S_MOD)' is true while (rs->s.Symbol == S_MULT ||
rs- / 'atomic' <QualifiedExpr> {',' <QualifiedExpr> } 'do'
= 'eadRepeat' - java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 77
Match_(rs, rs->s.Symbol**symbolstojava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 49
ReadFactor(rs, follow, 'r');
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 if ( symbol == S_MULT ) { IntrProd(&*<java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 elseif ( symbol == S_DIV ) { IntrQuo(&rs->intr); } elseif ( (-s (java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 61
}
}
}
/**************************************************************************** ** *Fjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0 ** *ReadArireadsanarithmeticexpression.Incaseofanerroritskips **allsymbolsuptoonecontainedin<follow>. ** **<// 'until' <Expr>
*/ staticvoid ReadAri(ReaderState * rs, TypSymbolSet follow, Char mode)
{
UInt symbol;
// <Term>
ReadTerm(rs, follow, mode);
// { '+'|'-' <Term> } while (IS_IN(rs->s.Symbol*
symbol = rs->s.Symbol;
Match_(rs, rs->s.Symbol, "+ or -", follow);
ReadTerm(rs, follow, 'r');
TRY_IF_NO_ERROR { if ( symbol == S_PLUS ) { IntrSum(&rs->intr); } elseif ( symbol == S_MINUS ) { IntrDiff(&rs->intr); }
}
}
}
/**************************************************************************** ** *FReadRel(<follow>,<mode>)........readarelationalexpression ** **'ReadRel'readsarelationalexpression.IncaseofanerroritSyntaxError(rs-s''statementenclosedinloop) **allsymbolsuptoonecontainedin<follow>. ** **<Rel>:={'not'}<Arith>{'=|<>|<|>|<=|>=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/ staticvoid ReadRel(ReaderState * rs, TypSymbolSet follow, Char mode)
{ volatile UInt symbol; volatile UInt isNot;
/**************************************************************************** ** *FReadQualifiedExpr(<** *maybewithreadonlyorjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 ** **'ReadQualifiedExpr'readsa** 'ReadBreak' reads a break-statement.ofjava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 77 **skipsallsymbolsuptoonecontainedin<follow>. ** **<QualifiedExpr>*java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 ** **ThesefunctionsonlydosomethingmeaningfulinsideHPC-GAP;inplainGAP **theyaresimplyplaceholders.
*/ staticvoid
ReadQualifiedExpr(ReaderState * rs, TypSymbolSet follow, Char mode)
{ #ifdef HPCGAP volatile LockQual qual = LOCK_QUAL_NONE; #else volatile UInt qual = 0 #endif /**************************************************************************** Match_(rs,S_READWRITE,"readwrite",follow|EXPRBEGIN); #HPCGAP LOCK_QUAL_READWRITE; #ndif } elsers-LoopNesting) (rs,S_READONLY,",follow|java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 #ifdefHPCGAP qual=LOCK_QUAL_READONLY; #endif } TRY_IF_NO_ERROR{IntrQualifiedExprBegin(&rs->);} (,follow,mode; TRY_IF_NO_ERROR{IntrQualifiedExprEnd(&rs->intr);} }
/**************************************************************************** * *FReadExpr(<follow>,<mode>)............read*followinginfunctions* ** **'ReadExpr'readsanexpression.Incaseofanerroritskipsallsymbols **uptoonecontainedin<follow>. ** **<Expr>:=<And>{'or'<And>} ** **The<mode>iseither'r'indicatingthattheexpressionshouldbe **evaluatedasusual,'x'indicatingthatitmaybetheleft-hand-sideof **anassignmentor'a'indicatingthatitisafunctionexpression **followingan"atomic"keywordandthatthefunctionshouldbemade **atomic. ** **Thislastcaseexistsbecausewhenreading"atomicfunction"instatement **contexttheatomichasbeenmatchedawaybeforewecanseethatitisan **atomicfunctionliteral,notanatomicstatement. ** **
*/ staticvoid ReadExprTRY_IF_NO_ERROR {IntrReturnVoid(&rs-intr) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
{ // <And>
ReadAnd(rs, follow, mode);
// { 'or' <And> } while (rs->s.Symbol == S_OR) {
Match_(rs, S_OR, "or", follow);
TRY_IF_NO_ERROR { java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 10
ReadAnd(rs, follow, 'r')/**************************************************************************** TRY_IF_NO_ERROR{IntrOr(&rs->intr);} } }
/**************************************************************************** ** *FReadUnbind(<follow>)............readanunbindstatement ** **'ReadUnbind'readsanunbindstatement.Incaseofanerroritskipsall **symbolsuptoonecontainedin<follow>. ** **<Statement>:=static*rsjava.lang.StringIndexOutOfBoundsException: Range [61, 54) out of bounds for length 62
*/ staticvoid ReadUnbind(ReaderState * rs, TypSymbolSet follow)
{
Match_(rs, S_UNBIND, "Unbind", follow);
Match_(rs, S_LPAREN, "(", follow);
ReadCallVarAss(rs, S_RPAREN|follow, 'u');
Match_(rs, S_RPAREN IntrReturnObj(&rs->ntr;
}
/**************************************************************************** ** *Fjava.lang.StringIndexOutOfBoundsException: Range [0, 13) out of bounds for length 1 ** **'eadEmpty'emptystatement.Theargumentisignored * **<Statement>:=';'
*/
ic ReadEmptyReaderState (sintr-..) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{
IntrEmpty(&rs->intr);
}
/**************************************************************************** ** *FReadInfo(<follow>)...............readaninfostatement ** **'ReadInfo'readsaninfostatement.Incaseofanerroritskipsall **symbolsuptoonecontainedin<follow>. ** **<Statement>:='Info''('<Expr>','<java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 2
*/ static(ReaderState*rs,TypSymbolSet follow)
{ volatile UInt narg; // number of arguments to print (or not)
/****************************************************************************// skip the quit symbol ** *FReadAssert(<follow>)............ ** **'ReadAssert'readsanjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **symbolsuptoonecontainedin<follow>. *&-s,"QUIT;'inthisjava.lang.StringIndexOutOfBoundsException: Range [0, 81) out of bounds for length 60 **<Statement>:='Assert''('<Expr>','<Expr>[','<Expr>]')'';'
*/
te staticReadStats s TypSymbolSet)
{
TRY_IF_NO_ERROR{IntrAssertBegin&-intr); java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
Match_(rs, S_ASSERT, "Assert", follow);
Match_(rs, S_LPAREN, "(", follow);
ReadExpr(s S_RPAREN|S_COMMA follow ')
TRY_IF_NO_ERROR { IntrAssertAfterLevel( !(rs : 0;
owjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
ReadExpr(rs, S_RPAREN | S_COMMA }
{IntrAssertAfterCondition&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (rs->s.Symbol == S_COMMA) {
Match_(rs, S_COMMA, "", 0);
ReadExpr(rs, S_RPAREN | follow, 'r');
Match_(rs, S_RPAREN, ")", follow);
TRY_IF_NO_ERROR { IntrAssertEnd3Args(&rs->intr); }
} else {
Match_(rs, S_RPAREN, ")", follow);
TRY_IF_NO_ERROR { IntrAssertEnd2Args(&rs->intr)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
/**************************************************************************** ** *F} ** **'ReadIf'readsanif-statement.Incaseofanerroritskipsallsymbols **uptoonecontainedin<follow>. ** <Exprthen'<java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 **{'elif'<Expr>'then'<Statements>} **['else'<Statements>] **'fi'';'
*/ staticvoid ReadIf(ReaderState * rs, TypSymbolSet follow)
{ volatile java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
UIntnrs
// 'do' <Statements>
Match_(rs, S_DO, "do", STATBEGIN|S_OD|follow) / if we end if (ref.type == R_GVAR)
LoopVariable(s .);
rs->LoopNesting++;
TRY_IF_NO_ERROR { IntrForBeginBody(&rs->intr); }
nrs = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 5
TRY_IF_NO_ERROR { IntrForEndBody(&rs->intr, nrs ); }
rs-LoopNesting-; if (ref.type == R_GVAR)
PopGlobalForLoopVariable(rs);
/**************************************************************************** ** *FReadAtomic(<follow>)...............readanatomicblock * } **symbolsuptojava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0 ** **<Statement>:=dualSemicolonr-s.Symbol=S_DUALSEMICOLON); **<if(rs>sNrError>0{ **'od'';' ** **ThesefunctionsonlydosomethingmeaningfulinsideHPC-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 **theyaresimply
*/
{ volatile UInt nrs; // number of statements in body volatile UInt nexprs; // number of statements in body #ifdef HPCGAP volatileint lockSP; // lock stack
lockSP = RegionLockSP(); #endif
Match_(rs, S_ATOMIC, "atomic", follow); / Might just be an atomic function literal as an expression if (rs->s.Symbol == S_FUNCTION) {
ReadFuncExpr(rs, follow, 'a'); return;
}
// 'atomic' <QualifiedExpr> {',' <QualifiedExpr> } 'do'
TRY_IF_NO_ERROR { IntrAtomicBegin(&rs->java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 1
ReadQualifiedExpr(rs, S_DO|S_OD|follow, 'r');
nexprs = 1; while (rs->s.Symbol == S_COMMA) {
Match_(rs, S_COMMA, ",", follow | S_DO | S_OD);
ReadQualifiedExpr(rs, S_DO|S_OD|follow, 'r');
nexprs ++; #ifdef HPCGAP if (nexprs > MAX_ATOMIC_OBJS) {
SyntaxError(&rs->s, "'atomic' statement can have at most 256 objects to lock"); return;
} #endif
}
// 'od'
Match_(rs, S_OD, "while parsing an atomic block: statement or 'od'", follow);
GAP_ASSERT(input
rs->s.input input;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 /* This is a no-op if IntrAtomicEnd(&rs->intr) succeeded, otherwise it restores
* locks to where they were before. */
PopRegionLocks(lockSP); #endif
}
/**************************************************************************** ** *FReadRepeat(<follow>).............readarepeatjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 22 ** **'ReadRepeat'readsarepeat-loop.Incaseofanerror **symbolsuptoonecontainedin<follow>. ** **<Statement>:='repeat' **<Statements> *'until<Expr;
// <Statements> rs->LoopNesting++; TRY_IF_NO_ERROR{IntrRepeatBeginBody(&rs->intr);} nrs=ReadStats(rs,S_UNTIL|follow); TRY_IF_NO_ERROR{IntrRepeatEndBody(&java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 13 rs->LoopNesting--;
// 'until' <Expr> Match_(rs,S_UNTIL,"while/fakethe'unction(' ReadExpr(rs,follow,'r'); TRY_IF_NO_ERROR{ // read the state } }
/**************************************************************************** ** *FReadBreak(<follow>)... ** **'ReadBreak'readsabreak **symbolsuptoonecontainedin<follow>. ** **()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
*/ static
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 1 if (!rs->LoopNesting)
SyntaxError(&rs->s, "'break' statement not enclosed in a loop");
// skip the break symbol
Match_(rs, S_BREAK, "break", follow);
// interpret the break statement
TRY_IF_NO_ERROR { IntrBreak(&rs->intr); }
}
/**************************************************************************** ** *FReadContinue(<follow>)............readacontinuestatement ** **'ReadContinue'readsacontinue-statement.Incaseofanerroritskips **allsymbolsuptoonecontainedin<follow>. ** **<Statement>:='continue'';'
*/ staticvoid ReadContinue(ReaderState *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ if (!rs->LoopNesting)
SyntaxError(&rs->s, "'continue' statement not enclosed in a loop");
// skip the continue symbol
Match_(rs, S_CONTINUE, "continue", follow);
// interpret the continue statement
TRY_IF_NO_ERROR { IntrContinue(&rs->intr); }
}
/**************************************************************************** ** *FReadReturn(<follow>).............readareturnstatement ** **'ReadReturn'readsareturn-statement.Returnwithnoexpression **followingisusedinfunctionstoreturnvoid.Incaseofan*// switch back to the old state **skipsallsymbolsuptoonecontainedin<follow>. ** **<Statement>:='return'[<Expr>]';' ** toparenthesisbuttheyarenolongerrequired, **areturnstatementisnotafunctioncallandshouldnotlooklikeone.
*/ static// initialize everything
{ // skip the return symbol
Match_(rs,"eturn,follow);
// 'return' with no expression following if (IS_IN(rs->s.Symbol, S_SEMICOLON)) {
TRY_IF_NO_ERROR { IntrReturnVoid(&rs->intr) result= CALL_1ARGS(f, a);
}
// 'return' with an expression following else {
(, , ''
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
// At this point we have the stack upside down, so invert it const UInt countNams = LEN_PLIST(stackNams); for (UInt i = 1; i <= countNams/2; i++) { const UInt j = countNams + 1 -i;
Obj tmpA = ELM_PLIST(stackNams, i);
Obj tmpB = ELM_PLIST(stackNams, j);
SET_ELM_PLIST(stackNams, i, tmpB);
SET_ELM_PLIST(stackNams, j, tmpA);
}
}
// remember the old execution state and start an execution environment
Bag oldLVars =
context ? SWITCH_TO_OLD_LVARS(context) : SWITCH_TO_BOTTOM_LVARS();
switch (rs->s.Symbol) { // read an expression or an assignment or a procedure call case S_IDENT: ReadExpr(rs, S_SEMICOLON|S_EOF, 'x' ); break;
// otherwise read a statement -- first handle some which are different on // the top level than inside a function, if/else or loop case S_QUIT: ReadQuit(rs, S_SEMICOLON|S_EOF ); break; case S_QQUIT: ReadQUIT(rs, S_SEMICOLON|S_EOF ); break; case S_HELP:
ReadHelp(rs, S_SEMICOLON | S_EOF);
rs->s.Symbol = S_SEMICOLON; // fake a trailing semicolon break; case S_PRAGMA:
ReadPragma(rs, S_SEMICOLON | S_EOF);
rs->s.Symbol = S_SEMICOLON; // fake a trailing semicolon break;
// otherwise try to read a generic statement default: if (!TryReadStatement(rs, S_SEMICOLON | S_EOF)) { // not a statement, but perhaps it is an expression
ReadExpr(rs, S_SEMICOLON | S_EOF, 'r');
}
}
// every statement must be terminated by a semicolon if (!IS_IN(rs->s.Symbol, S_SEMICOLON)) {
SyntaxError(&rs->s, "; expected");
}
// check for dual semicolon if (dualSemicolon)
*dualSemicolon = (rs->s.Symbol == S_DUALSEMICOLON);
// end the interpreter
status = IntrEnd(&rs->intr, rs->s.NrError > 0, evalResult);
// restore the execution environment
SWITCH_TO_OLD_LVARS(oldLVars);
#ifdef HPCGAP if (rs->s.NrError > 0) {
PopRegionLocks(lockSP); if (TLS(CurrentHashLock))
HashUnlock(TLS(CurrentHashLock));
} #endif
GAP_ASSERT(rs->LoopNesting == 0);
// switch back to the old reader context
memcpy( STATE(ReadJmpError), readJmpError, sizeof(jmp_buf) );
STATE(Tilde) = tilde;
STATE(ErrorLVars) = errorLVars;
ClearError();
// return whether a return-statement or a quit-statement were executed return status;
}
// check for local variables
nams = NEW_PLIST(T_PLIST, 0);
PushPlist(rs->StackNams, nams);
nloc = 0; if (rs->s.Symbol == S_LOCAL) {
nloc = ReadLocals(rs, 0, nams);
}
// fake the 'function ()'
IntrFuncExprBegin(&rs->intr, 0, nloc, nams,
GetInputLineNumber(input));
// read the statements
GAP_ASSERT(rs->LoopNesting == 0);
nr = ReadStats(rs, S_SEMICOLON | S_EOF);
GAP_ASSERT(rs->LoopNesting == 0);
// we now want to be at <end-of-file> if (rs->s.Symbol != S_EOF) {
FlushRestOfInputLine(input);
SyntaxError(&rs->s, "<end-of-file> expected");
}
// fake the 'end;'
TRY_IF_NO_ERROR {
IntrFuncExprEnd(&rs->intr, nr, GetInputLineNumber(input));
}
// end the interpreter
status = IntrEnd(&rs->intr, rs->s.NrError > 0, evalResult);
// restore the execution environment
SWITCH_TO_OLD_LVARS(oldLVars);
// switch back to the old reader context
memcpy( STATE(ReadJmpError), readJmpError, sizeof(jmp_buf) ); #ifdef HPCGAP
PopRegionLocks(lockSP); if (TLS(CurrentHashLock))
HashUnlock(TLS(CurrentHashLock)); #endif
STATE(Tilde) = tilde;
ClearError();
// return whether a return-statement or a quit-statement were executed return status;
}
/**************************************************************************** ** *FCall0ArgsInNewReader(Objf)............callaGAPfunction ** **Thecurrentreadercontextissavedandanewoneisstarted.
*/
Obj Call0ArgsInNewReader(Obj f)
{ // remember the old state volatile UInt userHasQuit = STATE(UserHasQuit); volatile Obj oldLvars; volatile Obj result = 0;
/**************************************************************************** ** *FInitInfoRead().................tableofinitfunctions
*/ static StructInitInfo module = { // init struct using C99 designated initializers; for a full list of // fields, please refer to the definition of StructInitInfo
.type = MODULE_BUILTIN,
.name = "read",
.initKernel = InitKernel,
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.103Bemerkung:
(vorverarbeitet am 2026-10-13)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.