!PLEASE NOTE: IACC FILE TO GENERATE A BYTECODE ASSEMBLER
!
!Copyright (c) 2006-2008, 2023 Claudio Calvelli, all rights reserved.
!
!CLC-INTERCAL is copyrighted software. However, permission to use, modify,
!and distribute it is granted provided that the conditions set out in the
!licence agreement are met. See files README and COPYING in the distribution.
!
!PERVERSION "CLC-INTERCAL/Base aux/asm.prefix 1.-94.-2.2"
!
# INITIALISATIONS
%BA <- 2
%RT <- ?TRADITIONAL
%WT <- 0
%CR <- ?ASCII
%CW <- ?ASCII
?TYPE <- ?ASSEMBLER
!
BYTECODE SPECIAL_REGISTER=* : SPECIAL_REGISTER
BYTECODE "#" CONSTANT=1 : CONSTANT
BYTECODE ":" ASM_CODE=1 : ASM_CODE
!
PROGRAM MAYBE_LABEL STATEMENT : "STS" * MAYBE_LABEL STATEMENT
# COMMENTS WITH A LABEL NEED TO STILL PARSE THE LABEL
PROGRAM LABEL : "STS" * LABEL
!
END_JUNK "DO" :
END_JUNK "PLEASE" :
END_JUNK LABEL :
END_JUNK "[" :
!
DO_PLEASE "DO" :
DO_PLEASE "PLEASE" :
DO_PLEASE "PLEASE" "DO" :
!
STATEMENT "[" BC_LIST "]" : BC_LIST
STATEMENT DO_PLEASE NOT JUNK : "NOT"
!
NOT "NOT" :
NOT "N" "'" "T" :
NOT "¬" :
!
MAYBE_LABEL :
MAYBE_LABEL LABEL : LABEL
LABEL "(" CONSTANT ")" : "LAB" CONSTANT
!
BC_LIST :
BC_LIST BYTECODE=* BC_LIST=* : BYTECODE BC_LIST
BC_LIST "[" INNER_LIST=* "]" BC_LIST : !INNER_LIST INNER_LIST BC_LIST
BC_LIST "{" BC_LIST=* "}" BC_LIST : !BC_LIST=1 BC_LIST=1 BC_LIST=2
!
INNER_LIST BC_LIST=1 : BC_LIST
INNER_LIST BC_LIST=1 "+" INNER_LIST=* : BC_LIST INNER_LIST
!
