public class ProfileParser extends Object
Modifier and Type | Field and Description |
---|---|
private static byte[][] |
c_action
There are six identified actions.
|
private static byte[][] |
c_state
Table to contain the state transition diagram for the parser.
|
Constructor and Description |
---|
ProfileParser() |
Modifier and Type | Method and Description |
---|---|
static String |
combine(List l)
Creates a profile string from the internal representation.
|
static String |
combine(Profiles p)
Creates a profile string from the internal representation.
|
static void |
main(String[] args)
Test program.
|
static List |
parse(String s)
Parses a given user profile specification into a map of maps.
|
private static final byte[][] c_state
| EOS | adu | , | ; | : | \ | " | = |other| | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ 0 | -,F |Cn,0 | -,E1| -,E1| -,1 | -,E1| -,E1| -,E1| -,E1| 1 | -,E2| -,E1| -,E1| -,E1| -,2 | -,E1| -,E1| -,E1| -,E1| 2 | -,F |Ck,2 | -,E1| -,E1| -,E1| -,E1| -,E1| -,3 |Ck,E1| 3 | -,E2|Cv,6 | -E1 | -,E1| -,E1| -,E1| -,4 | -,E1|Cv,6 | 4 | -,E2|Cv,4 |Cv,4 |Cv,4 |Cv,4 | -,5 | -,7 |Cv,4 |Cv,4 | 5 | -,E2|Cv,4 |Cv,4 |Cv,4 |Cv,4 |Cv,4 |Cv,4 |Cv,4 |Cv,4 | 6 |A1,F |Cv,6 |A2,2 |A1,0 | -,E1| -,E1| -,E1| -,E1|Cv,6 | 7 |A1,F | -,E1|A2,2 |A1,0 | -,E1| -,E1| -,E1| -,E1| -,E1| -----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ F | 8 | final state E1 | 9 | error1: illegal character in input E2 | 10 | error2: premature end of inputThe state variable collects the new state for a given state (rows) and input character set (column) identifier.
private static final byte[][] c_action
- | 0 | noop Cn | 1 | append input character to namespace field Ck | 2 | append input character to key field Cv | 3 | append input character to value field A1 | 4 | create triple and flush all fields A2 | 5 | create triple and flush key and value onlyThe action variable collects the action to take for a given state (rows) and input character set (column).
public static List parse(String s) throws ProfileParserException
s
- is the input string to parseProfileParserException
- if the input cannot be recognizedcombine( List m )
public static String combine(Profiles p)
l
- is a list of profilesparse( String s )
public static String combine(List l)
l
- is a list of profilesparse( String s )
public static void main(String[] args)
args
- are command-line argumentsCopyright © 2011 The University of Southern California. All Rights Reserved.