Prev: 60847 Up: Map Next: 61024
60910: Match Token In BASIC List
Used by the routine at JumpTable.
Jump-table target JumpTable_TokenHelper: using the delimiter in ParserState_TokenDelimiter, try SearchVocabulary_Prepositions (prepositions) and then walk a BASIC-resident word list via StepBasicListEntry. Returns BC=index or 0000.
MatchTokenInBasicList 60910 LD A,2 Set match length 2 and reset the word index.
60912 LD (23460),A
60915 DEC A
60916 LD (23461),A
60919 LD A,(23468) Jump to MatchTokenInBasicList_ClearDirty if the delimiter ends the line or is a quote.
60922 CP 13
60924 JR Z,MatchTokenInBasicList_ClearDirty
60926 CP 34
60928 JR Z,MatchTokenInBasicList_ClearDirty
60930 LD HL,(23463) Stash InputBuffer_TokenStart in HL, promote InputBuffer_NextToken as the current token, try a preposition match (SearchVocabulary_Prepositions) and seed ParserState_WordIndex to 1.
60933 PUSH HL
60934 LD HL,(23465)
60937 LD (23463),HL
60940 CALL SearchVocabulary_Prepositions
60943 LD A,1
60945 LD (23461),A
60948 POP HL Pop the stashed pointer back into InputBuffer_TokenStart via HL.
60949 LD (23463),HL
60952 LD A,C Jump to MatchTokenInBasicList_ClearDirty if C holds a preposition hit.
60953 AND A
60954 JR NZ,MatchTokenInBasicList_ClearDirty
60956 LD A,1 Mark the line dirty and scan the BASIC list.
60958 LD (23549),A
60961 JR MatchTokenInBasicList_Scan
MatchTokenInBasicList_ClearDirty 60963 SUB A Clear the dirty flag and use the BASIC-helper scan.
60964 LD (23549),A
60967 JR BasicHelper_Scan
MatchTokenInBasicList_Scan 60969 LD HL,(23639) Compare the next BASIC-list word to the token at InputBuffer_TokenStart.
60972 LD DE,8
60975 ADD HL,DE
60976 LD DE,(23463)
60980 PUSH HL
60981 CALL CompareTokenToWord
60984 POP HL
60985 JR C,MatchTokenInBasicList_AdvanceEntry
MatchTokenInBasicList_NextWord 60987 INC HL Skip to the next space-separated word in this entry.
60988 LD A,(HL)
60989 CP 34
60991 JR Z,MatchTokenInBasicList_AdvanceEntry
60993 CP 32
60995 JR NZ,MatchTokenInBasicList_NextWord
60997 INC HL Compare that word to the next input token.
60998 LD DE,(23465)
61002 CALL CompareTokenToWord
61005 JR NC,MatchTokenInBasicList_Hit
This entry point is used by the routine at BasicHelper.
MatchTokenInBasicList_AdvanceEntry 61007 CALL StepBasicListEntry Step to the next BASIC-list entry and keep scanning.
61010 CP B
61011 JR C,MatchTokenInBasicList_Scan
This entry point is used by the routines at BasicHelper and SeedPrimaryWorkBuffer.
MatchTokenInBasicList_Miss 61013 LD BC,0 BC=0000 on a miss.
61016 RET Return.
This entry point is used by the routines at BasicHelper and SeedPrimaryWorkBuffer.
MatchTokenInBasicList_Hit 61017 LD A,(23461) BC=the matched word index.
61020 LD C,A
61021 LD B,0
61023 RET Return.
Prev: 60847 Up: Map Next: 61024