DAFTAR_PRODUK
ADR001#12-11-5678#12-22-5678#12-33-5678#ALDESPI ARIFIN
ADR002#12-34-5678#12-34-5678#12-34-5678#EDWIENT FERNANDO
ADR003#12-34-5678#12-34-5678#12-34-5678#MUHAMMAD SYUKRI
ADR004#12-34-5678#12-34-5678#12-34-5678#RUHENDI SRIYADI
ADR005#12-34-5678#12-34-5678#12-34-5678#RIAN SAPUTRA
TUTUP
PESAN
SOURCE CODE
/*import java.util*/
%%
%public
%class tugas
%standalone
%unicode
%line
%column
%char
%table
%{
int kadaluarsa = 0;
int tKadaluarsa = 0;
int no=1;
int sisahari0; int sisabulan0; int sisatahun0;
int sisahari1; int sisabulan1; int sisatahun1;
int sisahari2; int sisabulan2; int sisatahun2;
int sisahari3; int sisabulan3; int sisatahun3;
int sisahari4; int sisabulan4; int sisatahun4;
int sisahari5; int sisabulan5; int sisatahun5;
int sisahari6; int sisabulan6; int sisatahun6;
int sisahari7; int sisabulan7; int sisatahun7;
int sisahari8; int sisabulan8; int sisatahun8;
int sisahari9; int sisabulan9; int sisatahun9;
String adr1; String msk0; String byr0;String tgl0;
String adr2; String msk1; String byr1;String tgl1;
String adr3; String msk2; String byr2;String tgl2;
String adr4; String msk3; String byr3;String tgl3;
String adr5; String msk4; String byr4;String tgl4;
String adr6; String msk5; String byr5;String tgl5;
String adr7; String msk6; String byr6;String tgl6;
String adr8; String msk7; String byr7;String tgl7;
String adr9; String msk8; String byr8;String tgl8;
String A1;
String A2;
String A3;
String A4;
String A5;
String A6;
String A7;
String A8;
String A9;
String tgl = "25-11-2014";
int i;
String scan[];
String scana;
%}
%%
"DAFTAR_PRODUK" {
System.out.println(" ");
System.out.println("=Tanggal (25-11-2014)====================================================");
System.out.println("=========================================================================");
System.out.println(" DAFTAR KREDITUR ");
System.out.println("=========================================================================");
}
"PESAN" {
System.out.println("PERHATIAN!!");
System.out.println("Mohon Segara Ditindak Lanjuti");
if (sisabulan0 == 120)
System.out.println("1. " + A1);
System.out.println (" => TERIMA KASIH. <=");
}
[A-Z][A-Z][A-Z][0-9][0-9][0-9]#[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]#[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]#[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]#[A-Za-z ]* {
scana = yytext();
/*
bm0 = BulanMasuk
ba0 = Bulan Akhir
*/
String br0 = scana.substring(10,12);
String by0 = scana.substring(8,9);
String aw0 = scana.substring(7,9);
String bt0 = scana.substring(8,9);
String adr1 = scana.substring(0,6);
/** tanggal */ String ta0 = tgl.substring(3,5);
String ak0 = tgl.substring(6,10);
/** tanggal */
/* Lengkap */
String tgl0 = scana.substring(29,39);
String byr0 = scana.substring(18,28);
msk0 = scana.substring(7,17);
A1 = scana.substring(40);
kadaluarsa++;
System.out.println("ID :" + adr1 );
System.out.println("NAMA :" + A1 );
System.out.println("-------------------------------------------------------------------------");
System.out.println("TANGGAL MASUK :" + msk0 + " " + "TOTAL BULAN :" + "23" +"bulan" );
System.out.println("BAYAR TERAKHIR :" + byr0 + " " + "BULAN DIBAYAR :" + "23" +"bulan" );
System.out.println("TANGGAL MASUK :" + tgl0 + " " + "TUNGGAKAN :" + "23" +"bulan" );
System.out.println("-------------------------------------------------------------------------");
}
"TUTUP" {
System.out.println (" (TOTAL = " + kadaluarsa + ")");
System.out.println (" ");
}
. {System.out.print(yytext());}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.