867 ^ self parseValue |
867 ^ self parseValue |
868 |
868 |
869 "Created: / 18-06-2014 / 07:39:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
869 "Created: / 18-06-2014 / 07:39:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
870 ! |
870 ! |
871 |
871 |
|
872 parseValueAsListElementDescribedBy:descriptor |
|
873 self peek isAlphaNumeric ifTrue:[ |
|
874 self parseVariable. |
|
875 self expect: $=. |
|
876 ]. |
|
877 ^ descriptor parseUsingGDBMIParser:self |
|
878 |
|
879 "Created: / 11-11-2017 / 12:19:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
880 ! |
|
881 |
872 parseValueAsListOf: class |
882 parseValueAsListOf: class |
873 | description | |
883 | description | |
874 |
884 |
875 class == Boolean ifTrue:[ |
885 class == Boolean ifTrue:[ |
876 description := Magritte::MABooleanDescription new. |
886 description := Magritte::MABooleanDescription new. |
889 "Created: / 18-06-2014 / 21:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 "Created: / 18-06-2014 / 21:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
890 "Modified: / 23-09-2014 / 23:17:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
900 "Modified: / 23-09-2014 / 23:17:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
891 ! |
901 ! |
892 |
902 |
893 parseValueAsListOf:class describedBy:descriptor |
903 parseValueAsListOf:class describedBy:descriptor |
894 | list | |
904 ^ self parseValueAsListOf:class describedBy:descriptor allowOmmitedBrackets: false |
895 |
905 |
896 self peek ~~ $[ ifTrue:[ ^ self parseValue ]. |
906 "Created: / 18-06-2014 / 21:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
897 self next. "/ eat ${ |
907 "Modified: / 11-11-2017 / 12:14:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
898 self peek ~~ $] ifTrue:[ |
908 ! |
899 list := OrderedCollection new. |
909 |
|
910 parseValueAsListOf:class describedBy:descriptor allowOmmitedBrackets: allowOmmitedBrackets |
|
911 | list bracketsOmmited | |
|
912 |
|
913 |
|
914 |
|
915 self peek == $[ ifTrue:[ |
|
916 self next. "/ eat $[ |
|
917 bracketsOmmited := false. |
|
918 ] ifFalse:[ |
|
919 allowOmmitedBrackets ifFalse:[ |
|
920 ^ self parseValue |
|
921 ]. |
|
922 bracketsOmmited := true. |
|
923 ]. |
|
924 |
|
925 list := OrderedCollection new. |
|
926 bracketsOmmited ifTrue:[ |
900 [ |
927 [ |
901 self peek isAlphaNumeric ifTrue:[ |
928 list add: (self parseValueAsListElementDescribedBy: descriptor). |
902 self parseVariable. |
929 ] doWhile:[ |
903 self expect: $=. |
930 (self peek == $,) ifTrue:[ self next ]. |
|
931 self peek == ${ |
|
932 ]. |
|
933 ] ifFalse:[ |
|
934 self peek ~~ $] ifTrue:[ |
|
935 [ |
|
936 list add: (self parseValueAsListElementDescribedBy: descriptor). |
|
937 ] doWhile: [ |
|
938 (self peek == $,) ifTrue:[ self next. true ] ifFalse:[ false ] |
904 ]. |
939 ]. |
905 list add: (descriptor parseUsingGDBMIParser:self) |
940 ]. |
906 ] doWhile: [ |
941 ]. |
907 (self peek == $,) ifTrue:[ self next. true ] ifFalse:[ false ] |
942 |
908 ]. |
943 bracketsOmmited ifFalse:[ |
909 ]. |
944 self expect: $]. "/ eats $] |
910 self expect: $]. |
945 ]. |
911 ^ list |
946 ^ list asNilIfEmpty. |
912 |
947 |
913 "Created: / 18-06-2014 / 21:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
948 "Created: / 11-11-2017 / 12:14:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
914 "Modified: / 17-09-2014 / 08:03:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
949 "Modified: / 12-11-2017 / 17:22:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
915 ! |
950 ! |
916 |
951 |
917 parseValueAsString |
952 parseValueAsString |
918 ^ self parseCString |
953 ^ self parseCString |
919 |
954 |