From b9a4038e42fb9eefe8ff68fcb3ad2eca95c199c3 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 7 May 2014 01:01:24 +0200 Subject: [PATCH] Callback boilerplate for the Java lexer. --- ext/java/org/liboga/xml/Lexer.rl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ext/java/org/liboga/xml/Lexer.rl b/ext/java/org/liboga/xml/Lexer.rl index ae3ee72..c92321e 100644 --- a/ext/java/org/liboga/xml/Lexer.rl +++ b/ext/java/org/liboga/xml/Lexer.rl @@ -1,6 +1,6 @@ package org.liboga.xml; -%%machine lexer; +%%machine java_lexer; import java.io.IOException; @@ -67,17 +67,25 @@ public class Lexer extends RubyObject int eof = 0; int top = 0; - int[] stack = {}; + int[] stack = new int[8]; %% write init; %% write exec; return context.nil; } + + public void callback(String name, byte[] data, Encoding enc, int ts, int te) + { + + } + + public void callback_simple(String name) + { + + } } %%{ - main := |* - any; - *|; + include base_lexer "base_lexer.rl"; }%%